Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## api
Class Nes::Api::Input

    Base
       |
       +--Nes::Api::Input

class Nes::Api::Input
extends Base

Controller input interface.

Inner Classes, Typedefs, and Enums
`enum` | `Nes::Api::Input::Adapter` Adapter type.
`typedef` | `Nes::Api::Input::AdapterCallback` Adapter event callback prototype.
`typedef` | `Nes::Api::Input::ControllerCallback` Controller event callback prototype.
`typedef` | `Nes::Api::Input::Controllers` Controllers context.
`enum` | `Nes::Api::Input::Type` Controller type.

Field Summary
`static Nes::Api::Input::AdapterCaller` | `adapterCallback` Adapter event callback manager.
`static Nes::Api::Input::ControllerCaller` | `controllerCallback` Controller event callback manager.

Constructor Summary
`Input( T& instance )` Interface constructor.

Method Summary
`Result` | `AutoSelectAdapter()` Connects the most suited adapter for a game.
`Result` | `AutoSelectController( uint port )` Connects the most suited controller for a game into a port.
`Result` | `AutoSelectControllers()` Connects the most suited controllers for a game into all ports.
`Result` | `ConnectAdapter( Nes::Api::Input::Adapter type )` Connects an adapter.
`Result` | `ConnectController( uint port, Nes::Api::Input::Type type )` Connects a controller to a port.
`Nes::Api::Input::Adapter` | `GetConnectedAdapter() const` Returns the current connected adapter.
`Nes::Api::Input::Type` | `GetConnectedController( uint port ) const` Returns the current connected controller.
`bool` | `IsControllerConnected( Nes::Api::Input::Type type ) const` Checks if a specific controller is connected.

Field Detail

### adapterCallback

    public static Nes::Api::Input::AdapterCaller adapterCallback;

  Adapter event callback manager. Static object used for adding the user defined callback.

### controllerCallback

    public static Nes::Api::Input::ControllerCaller controllerCallback;

  Controller event callback manager. Static object used for adding the user defined callback.

Constructor Detail

### Input

    public Input( T& instance );

  Interface constructor.

Parameters:
  `instance` - emulator instance

Method Detail

### AutoSelectAdapter

    public Result AutoSelectAdapter() throw();

  Connects the most suited adapter for a game.

### AutoSelectController

    public Result AutoSelectController( uint port ) throw();

  Connects the most suited controller for a game into a port.

Parameters:
  `port` - controller port
Returns:
  result code

### AutoSelectControllers

    public Result AutoSelectControllers() throw();

  Connects the most suited controllers for a game into all ports.

Returns:
  result code

### ConnectAdapter

    public Result ConnectAdapter( Nes::Api::Input::Adapter type ) throw();

  Connects an adapter.

Parameters:
  `type` - adapter
Returns:
  result code

### ConnectController

    public Result ConnectController( uint port, Nes::Api::Input::Type type ) throw();

  Connects a controller to a port.

Parameters:
  `port` - port
  `type` - controller

### GetConnectedAdapter

    public Nes::Api::Input::Adapter GetConnectedAdapter() const throw();

  Returns the current connected adapter.

Returns:
  adapter

### GetConnectedController

    public Nes::Api::Input::Type GetConnectedController( uint port ) const throw();

  Returns the current connected controller.

Parameters:
  `port` - port
Returns:
  controller

### IsControllerConnected

    public bool IsControllerConnected( Nes::Api::Input::Type type ) const throw();

  Checks if a specific controller is connected.

Parameters:
  `type` - controller
Returns:
  true if connected

Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD