Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

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...
 

Detailed Description

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.

Macro Definition Documentation

◆ DEFAULT_PORT_ADDRESS

#define DEFAULT_PORT_ADDRESS   "/1"

Port address used when topology is unknown

◆ DEFAULT_PORT_ID

#define DEFAULT_PORT_ID   "1"

Port ID used when topology is unknown

◆ KEYBOARD_PORT_ADDRESS

#define KEYBOARD_PORT_ADDRESS   "/keyboard"

**Port address used for the keyboard input device

◆ KEYBOARD_PORT_ID

#define KEYBOARD_PORT_ID   "keyboard"

**Port ID used for the keyboard input device

◆ MOUSE_PORT_ADDRESS

#define MOUSE_PORT_ADDRESS   "/mouse"

**Port address used for the mouse input device

◆ MOUSE_PORT_ID

#define MOUSE_PORT_ID   "mouse"

**Port ID used for the mouse input device

◆ ROOT_PORT_ADDRESS

#define ROOT_PORT_ADDRESS   "/"

**Root address of the controller tree

Typedef Documentation

◆ game_abs_pointer_event

typedef struct game_abs_pointer_event game_abs_pointer_event

An absolute pointer event, such as a touchscreen or tablet motion.

◆ game_accelerometer_event

typedef struct game_accelerometer_event game_accelerometer_event

An accelerometer event.

◆ game_analog_button_event

typedef struct game_analog_button_event game_analog_button_event

An analog button event, such as a trigger press or release.

◆ game_analog_stick_event

typedef struct game_analog_stick_event game_analog_stick_event

An analog stick event, such as a joystick's motion.

Todo
Document which coordinate system is used, left-hand or right-hand.

◆ game_axis_event

typedef struct game_axis_event game_axis_event

An axis event, such as a joystick or accelerometer.

◆ game_controller_layout

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.

◆ game_digital_button_event

typedef struct game_digital_button_event game_digital_button_event

A digital button event, such as a button press or release.

◆ game_input_device

typedef struct game_input_device game_input_device

Device that can provide input.

◆ game_input_event

typedef struct game_input_event game_input_event

An input event.

◆ GAME_INPUT_EVENT_SOURCE

Type of input event.

◆ game_input_port

typedef struct game_input_port game_input_port

Port that can provide input.

◆ game_input_topology

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.

◆ game_key_event

typedef struct game_key_event game_key_event

A key event, such as a key press or release.

◆ GAME_KEY_MOD

typedef enum GAME_KEY_MOD GAME_KEY_MOD

A modifier key pressed to give another key a special meaning.

◆ game_motor_event

typedef struct game_motor_event game_motor_event

A motor vibration event.

◆ GAME_PORT_TYPE

Type of port on the virtual game console.

◆ game_rel_pointer_event

typedef struct game_rel_pointer_event game_rel_pointer_event

A relative pointer event, such as a mouse motion.

Enumeration Type Documentation

◆ GAME_INPUT_EVENT_SOURCE

Type of input event.

Enumerator
GAME_INPUT_EVENT_DIGITAL_BUTTON 

Digital button press or release.

GAME_INPUT_EVENT_ANALOG_BUTTON 

Analog button motion.

GAME_INPUT_EVENT_AXIS 

Axis motion.

GAME_INPUT_EVENT_ANALOG_STICK 

Analog stick motion.

GAME_INPUT_EVENT_ACCELEROMETER 

Accelerometer motion.

GAME_INPUT_EVENT_KEY 

Key press or release.

GAME_INPUT_EVENT_RELATIVE_POINTER 

Relative pointer motion.

GAME_INPUT_EVENT_ABSOLUTE_POINTER 

Absolute pointer motion.

GAME_INPUT_EVENT_MOTOR 

Motor vibration.

◆ GAME_KEY_MOD

A modifier key pressed to give another key a special meaning.

Enumerator
GAME_KEY_MOD_NONE 

No modifier key.

GAME_KEY_MOD_SHIFT 

Shift key.

GAME_KEY_MOD_CTRL 

Control key.

GAME_KEY_MOD_ALT 

Alt key.

GAME_KEY_MOD_META 

Meta key.

GAME_KEY_MOD_SUPER 

Windows key.

GAME_KEY_MOD_NUMLOCK 

Num Lock key.

GAME_KEY_MOD_CAPSLOCK 

Caps Lock key.

GAME_KEY_MOD_SCROLLOCK 

Scroll Lock key.

◆ 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.