![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Input types More...
Topics | |
class GameControllerLayout | |
Data of layouts for known controllers. | |
Classes | |
struct | game_controller_layout |
"C" Game add-on controller layout. More... | |
struct | game_input_device |
Device that can provide input. More... | |
struct | game_input_port |
Port that can provide input. More... | |
struct | game_input_topology |
The input topology is the possible ways to connect input devices. More... | |
struct | game_digital_button_event |
A digital button event, such as a button press or release. More... | |
struct | game_analog_button_event |
An analog button event, such as a trigger press or release. More... | |
struct | game_axis_event |
An axis event, such as a joystick or accelerometer. More... | |
struct | game_analog_stick_event |
An analog stick event, such as a joystick's motion. More... | |
struct | game_accelerometer_event |
An accelerometer event. More... | |
struct | game_key_event |
A key event, such as a key press or release. More... | |
struct | game_rel_pointer_event |
A relative pointer event, such as a mouse motion. More... | |
struct | game_abs_pointer_event |
An absolute pointer event, such as a touchscreen or tablet motion. More... | |
struct | game_motor_event |
A motor vibration event. More... | |
struct | game_input_event |
An input event. More... | |
Macros | |
#define | ROOT_PORT_ADDRESS "/" |
**Root address of the controller tree | |
#define | DEFAULT_PORT_ID "1" |
Port ID used when topology is unknown | |
#define | KEYBOARD_PORT_ID "keyboard" |
**Port ID used for the keyboard input device | |
#define | MOUSE_PORT_ID "mouse" |
**Port ID used for the mouse input device | |
#define | DEFAULT_PORT_ADDRESS "/1" |
Port address used when topology is unknown | |
#define | KEYBOARD_PORT_ADDRESS "/keyboard" |
**Port address used for the keyboard input device | |
#define | MOUSE_PORT_ADDRESS "/mouse" |
**Port address used for the mouse input device | |
Typedefs | |
typedef enum GAME_INPUT_EVENT_SOURCE | GAME_INPUT_EVENT_SOURCE |
Type of input event. | |
typedef enum GAME_KEY_MOD | GAME_KEY_MOD |
A modifier key pressed to give another key a special meaning. | |
typedef enum GAME_PORT_TYPE | GAME_PORT_TYPE |
Type of port on the virtual game console. | |
typedef struct game_controller_layout | game_controller_layout |
"C" Game add-on controller layout. | |
typedef struct game_input_device | game_input_device |
Device that can provide input. | |
typedef struct game_input_port | game_input_port |
Port that can provide input. | |
typedef struct game_input_topology | game_input_topology |
The input topology is the possible ways to connect input devices. | |
typedef struct game_digital_button_event | game_digital_button_event |
A digital button event, such as a button press or release. | |
typedef struct game_analog_button_event | game_analog_button_event |
An analog button event, such as a trigger press or release. | |
typedef struct game_axis_event | game_axis_event |
An axis event, such as a joystick or accelerometer. | |
typedef struct game_analog_stick_event | game_analog_stick_event |
An analog stick event, such as a joystick's motion. | |
typedef struct game_accelerometer_event | game_accelerometer_event |
An accelerometer event. | |
typedef struct game_key_event | game_key_event |
A key event, such as a key press or release. | |
typedef struct game_rel_pointer_event | game_rel_pointer_event |
A relative pointer event, such as a mouse motion. | |
typedef struct game_abs_pointer_event | game_abs_pointer_event |
An absolute pointer event, such as a touchscreen or tablet motion. | |
typedef struct game_motor_event | game_motor_event |
A motor vibration event. | |
typedef struct game_input_event | game_input_event |
An input event. | |
Enumerations | |
enum | GAME_INPUT_EVENT_SOURCE { GAME_INPUT_EVENT_DIGITAL_BUTTON , GAME_INPUT_EVENT_ANALOG_BUTTON , GAME_INPUT_EVENT_AXIS , GAME_INPUT_EVENT_ANALOG_STICK , GAME_INPUT_EVENT_ACCELEROMETER , GAME_INPUT_EVENT_KEY , GAME_INPUT_EVENT_RELATIVE_POINTER , GAME_INPUT_EVENT_ABSOLUTE_POINTER , GAME_INPUT_EVENT_MOTOR } |
Type of input event. More... | |
enum | GAME_KEY_MOD { GAME_KEY_MOD_NONE = 0x0000 , GAME_KEY_MOD_SHIFT = 0x0001 , GAME_KEY_MOD_CTRL = 0x0002 , GAME_KEY_MOD_ALT = 0x0004 , GAME_KEY_MOD_META = 0x0008 , GAME_KEY_MOD_SUPER = 0x0010 , GAME_KEY_MOD_NUMLOCK = 0x0100 , GAME_KEY_MOD_CAPSLOCK = 0x0200 , GAME_KEY_MOD_SCROLLOCK = 0x0400 } |
A modifier key pressed to give another key a special meaning. More... | |
enum | GAME_PORT_TYPE { GAME_PORT_UNKNOWN , GAME_PORT_KEYBOARD , GAME_PORT_MOUSE , GAME_PORT_CONTROLLER } |
Type of port on the virtual game console. More... | |
Input types
Input consists of two categories: Input events and input topology.
The events are the changes in that state. For example, a button press is an event.
The topology is the tree that describes the entire hardware state of the virtual game console. This includes all port connections and physical properties of the devices.
Ports can accept multiple devices and devices can have multiple ports, so the topology of possible configurations is a tree structure of alternating port and device nodes. The root of the controller tree is /
.
The port address combined with the controller ID identifies the controller by its path in the controller tree. For example, a controller attached to port 1
could be /1/game.controller.default
.
The keyboard and mouse are automatically assigned a port address and the "id" parameter in the game add-on's topology.xml is ignored. The keyboard is /keyboard
and the mouse is /mouse
.
#define DEFAULT_PORT_ADDRESS "/1" |
Port address used when topology is unknown
#define DEFAULT_PORT_ID "1" |
Port ID used when topology is unknown
#define KEYBOARD_PORT_ADDRESS "/keyboard" |
**Port address used for the keyboard input device
#define KEYBOARD_PORT_ID "keyboard" |
**Port ID used for the keyboard input device
#define MOUSE_PORT_ADDRESS "/mouse" |
**Port address used for the mouse input device
#define MOUSE_PORT_ID "mouse" |
**Port ID used for the mouse input device
#define ROOT_PORT_ADDRESS "/" |
**Root address of the controller tree
typedef struct game_abs_pointer_event game_abs_pointer_event |
An absolute pointer event, such as a touchscreen or tablet motion.
typedef struct game_accelerometer_event game_accelerometer_event |
An accelerometer event.
typedef struct game_analog_button_event game_analog_button_event |
An analog button event, such as a trigger press or release.
typedef struct game_analog_stick_event game_analog_stick_event |
An analog stick event, such as a joystick's motion.
typedef struct game_axis_event game_axis_event |
An axis event, such as a joystick or accelerometer.
typedef struct game_controller_layout game_controller_layout |
"C" Game add-on controller layout.
Structure used to interface in "C" between Kodi and Addon.
See AddonGameControllerLayout for description of values.
typedef struct game_digital_button_event game_digital_button_event |
A digital button event, such as a button press or release.
typedef struct game_input_device game_input_device |
Device that can provide input.
typedef struct game_input_event game_input_event |
An input event.
typedef enum GAME_INPUT_EVENT_SOURCE GAME_INPUT_EVENT_SOURCE |
Type of input event.
typedef struct game_input_port game_input_port |
Port that can provide input.
typedef struct game_input_topology game_input_topology |
The input topology is the possible ways to connect input devices.
This represents the logical topology, which is the possible connections that the game client's logic can handle. It is strictly a subset of the physical topology. Loops are not allowed.
typedef struct game_key_event game_key_event |
A key event, such as a key press or release.
typedef enum GAME_KEY_MOD GAME_KEY_MOD |
A modifier key pressed to give another key a special meaning.
typedef struct game_motor_event game_motor_event |
A motor vibration event.
typedef enum GAME_PORT_TYPE GAME_PORT_TYPE |
Type of port on the virtual game console.
typedef struct game_rel_pointer_event game_rel_pointer_event |
A relative pointer event, such as a mouse motion.
Type of input event.
enum GAME_KEY_MOD |
A modifier key pressed to give another key a special meaning.
enum GAME_PORT_TYPE |
Type of port on the virtual game console.
Enumerator | |
---|---|
GAME_PORT_UNKNOWN | Game port unknown. |
GAME_PORT_KEYBOARD | Game port Keyboard. |
GAME_PORT_MOUSE | Game port mouse. |
GAME_PORT_CONTROLLER | Game port controller. |