Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Input operations More...
Functions | |
virtual bool | kodi::addon::CInstanceGame::HasFeature (const std::string &controller_id, const std::string &feature_name) |
Check if input is accepted for a feature on the controller. | |
virtual game_input_topology * | kodi::addon::CInstanceGame::GetTopology () |
Get the input topology that specifies which controllers can be connected. | |
virtual void | kodi::addon::CInstanceGame::FreeTopology (game_input_topology *topology) |
Free the topology's resources. | |
virtual void | kodi::addon::CInstanceGame::SetControllerLayouts (const std::vector< kodi::addon::GameControllerLayout > &controllers) |
Set the layouts for known controllers. | |
virtual bool | kodi::addon::CInstanceGame::EnableKeyboard (bool enable, const std::string &controller_id) |
Enable/disable keyboard input using the specified controller. | |
virtual bool | kodi::addon::CInstanceGame::EnableMouse (bool enable, const std::string &controller_id) |
Enable/disable mouse input using the specified controller. | |
virtual bool | kodi::addon::CInstanceGame::ConnectController (bool connect, const std::string &port_address, const std::string &controller_id) |
Connect/disconnect a controller to a port on the virtual game console. | |
virtual bool | kodi::addon::CInstanceGame::InputEvent (const game_input_event &event) |
Notify the add-on of an input event. | |
bool | kodi::addon::CInstanceGame::KodiInputEvent (const game_input_event &event) |
Callback to Kodi Function Notify the port of an input event | |
Input operations
Hardware rendering operation parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
|
inlinevirtual |
Connect/disconnect a controller to a port on the virtual game console.
[in] | connect | True to connect a controller, false to disconnect |
[in] | port_address | The address of the port |
[in] | controller_id | The controller ID if connecting, or unused if disconnecting |
controller
was (dis-)connected to the port, false otherwiseThe address is a string that allows traversal of the controller topology. It is formed by alternating port IDs and controller IDs separated by "/".
For example, assume that the topology represented in XML for Snes9x is:
To connect a multitap to the console's first port, the multitap's controller info is set using the port address:
/1
To connect a SNES controller to the second port of the multitap, the controller info is next set using the address:
/1/game.controller.multitap/2
Any attempts to connect a controller to a port on a disconnected multitap will return false.
|
inlinevirtual |
Enable/disable keyboard input using the specified controller.
[in] | enable | True to enable input, false otherwise |
[in] | controller_id | The controller ID if enabling, or unused if disabling |
|
inlinevirtual |
Enable/disable mouse input using the specified controller.
[in] | enable | True to enable input, false otherwise |
[in] | controller_id | The controller ID if enabling, or unused if disabling |
|
inlinevirtual |
Free the topology's resources.
[in] | topology | The topology returned by GetTopology() |
|
inlinevirtual |
Get the input topology that specifies which controllers can be connected.
If this returns non-null, topology must be freed using FreeTopology().
If this returns null, the topology will default to a single port that can accept all controllers imported by addon.xml. The port ID is set to the DEFAULT_PORT_ID constant.
|
inlinevirtual |
Check if input is accepted for a feature on the controller.
If only a subset of the controller profile is used, this can return false for unsupported features to not absorb their input.
If the entire controller profile is used, this should always return true.
[in] | controller_id | The ID of the controller profile |
[in] | feature_name | The name of a feature in that profile |
|
inlinevirtual |
Notify the add-on of an input event.
[in] | event | The input event |
|
inline |
Callback to Kodi Function
Notify the port of an input event
[in] | event | The input event |
|
inlinevirtual |
Set the layouts for known controllers.
[in] | controllers | The controller layouts |
After loading the input topology, the frontend will call this with controller layouts for all controllers discovered in the topology.