Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
peripheral.h File Reference
#include "../addon_base.h"

Classes

struct  PERIPHERAL_INFO
 Information shared between peripherals. More...
 
struct  PERIPHERAL_CAPABILITIES
 Peripheral add-on capabilities. More...
 
struct  PERIPHERAL_EVENT
 Event information. More...
 
struct  JOYSTICK_INFO
 Info specific to joystick peripherals. More...
 
struct  JOYSTICK_DRIVER_BUTTON
 Button primitive. More...
 
struct  JOYSTICK_DRIVER_HAT
 Hat direction primitive. More...
 
struct  JOYSTICK_DRIVER_SEMIAXIS
 Semiaxis primitive. More...
 
struct  JOYSTICK_DRIVER_MOTOR
 Motor primitive. More...
 
struct  JOYSTICK_DRIVER_KEY
 Keyboard key primitive. More...
 
struct  JOYSTICK_DRIVER_MOUSE_BUTTON
 Mouse button primitive. More...
 
struct  JOYSTICK_DRIVER_RELPOINTER
 Relative pointer direction primitive. More...
 
struct  JOYSTICK_DRIVER_PRIMITIVE
 Driver primitive struct. More...
 
struct  JOYSTICK_FEATURE
 Mapping between higher-level controller feature and its driver primitives. More...
 
struct  AddonProps_Peripheral
 
struct  AddonToKodiFuncTable_Peripheral
 
struct  KodiToAddonFuncTable_Peripheral
 
struct  AddonInstance_Peripheral
 

Macros

#define NO_PORT_REQUESTED   (-1)
 
#define DRIVER_INDEX_UNKNOWN   (-1)
 

Typedefs

typedef enum PERIPHERAL_ERROR PERIPHERAL_ERROR
 
typedef enum PERIPHERAL_TYPE PERIPHERAL_TYPE
 
typedef struct PERIPHERAL_INFO PERIPHERAL_INFO
 Information shared between peripherals.
 
typedef struct PERIPHERAL_CAPABILITIES PERIPHERAL_CAPABILITIES
 Peripheral add-on capabilities.
 
typedef enum PERIPHERAL_EVENT_TYPE PERIPHERAL_EVENT_TYPE
 
typedef enum JOYSTICK_STATE_BUTTON JOYSTICK_STATE_BUTTON
 
typedef enum JOYSTICK_STATE_HAT JOYSTICK_STATE_HAT
 
typedef float JOYSTICK_STATE_AXIS
 Axis value in the closed interval [-1.0, 1.0].
 
typedef float JOYSTICK_STATE_MOTOR
 Motor value in the closed interval [0.0, 1.0].
 
typedef struct PERIPHERAL_EVENT PERIPHERAL_EVENT
 Event information.
 
typedef struct JOYSTICK_INFO JOYSTICK_INFO
 Info specific to joystick peripherals.
 
typedef enum JOYSTICK_DRIVER_PRIMITIVE_TYPE JOYSTICK_DRIVER_PRIMITIVE_TYPE
 
typedef struct JOYSTICK_DRIVER_BUTTON JOYSTICK_DRIVER_BUTTON
 Button primitive.
 
typedef enum JOYSTICK_DRIVER_HAT_DIRECTION JOYSTICK_DRIVER_HAT_DIRECTION
 
typedef struct JOYSTICK_DRIVER_HAT JOYSTICK_DRIVER_HAT
 Hat direction primitive.
 
typedef enum JOYSTICK_DRIVER_SEMIAXIS_DIRECTION JOYSTICK_DRIVER_SEMIAXIS_DIRECTION
 
typedef struct JOYSTICK_DRIVER_SEMIAXIS JOYSTICK_DRIVER_SEMIAXIS
 Semiaxis primitive.
 
typedef struct JOYSTICK_DRIVER_MOTOR JOYSTICK_DRIVER_MOTOR
 Motor primitive.
 
typedef struct JOYSTICK_DRIVER_KEY JOYSTICK_DRIVER_KEY
 Keyboard key primitive.
 
typedef enum JOYSTICK_DRIVER_MOUSE_INDEX JOYSTICK_DRIVER_MOUSE_INDEX
 
typedef struct JOYSTICK_DRIVER_MOUSE_BUTTON JOYSTICK_DRIVER_MOUSE_BUTTON
 Mouse button primitive.
 
typedef enum JOYSTICK_DRIVER_RELPOINTER_DIRECTION JOYSTICK_DRIVER_RELPOINTER_DIRECTION
 
typedef struct JOYSTICK_DRIVER_RELPOINTER JOYSTICK_DRIVER_RELPOINTER
 Relative pointer direction primitive.
 
typedef struct JOYSTICK_DRIVER_PRIMITIVE JOYSTICK_DRIVER_PRIMITIVE
 Driver primitive struct.
 
typedef enum JOYSTICK_FEATURE_TYPE JOYSTICK_FEATURE_TYPE
 
typedef enum JOYSTICK_FEATURE_PRIMITIVE JOYSTICK_FEATURE_PRIMITIVE
 
typedef struct JOYSTICK_FEATURE JOYSTICK_FEATURE
 Mapping between higher-level controller feature and its driver primitives.
 
typedef struct AddonProps_Peripheral AddonProps_Peripheral
 
typedef struct AddonToKodiFuncTable_Peripheral AddonToKodiFuncTable_Peripheral
 
typedef struct KodiToAddonFuncTable_Peripheral KodiToAddonFuncTable_Peripheral
 
typedef struct AddonInstance_Peripheral AddonInstance_Peripheral
 

Enumerations

enum  PERIPHERAL_ERROR {
  PERIPHERAL_NO_ERROR = 0 , PERIPHERAL_ERROR_UNKNOWN = -1 , PERIPHERAL_ERROR_FAILED = -2 , PERIPHERAL_ERROR_INVALID_PARAMETERS = -3 ,
  PERIPHERAL_ERROR_NOT_IMPLEMENTED = -4 , PERIPHERAL_ERROR_NOT_CONNECTED = -5 , PERIPHERAL_ERROR_CONNECTION_FAILED = -6
}
 
enum  PERIPHERAL_TYPE { PERIPHERAL_TYPE_UNKNOWN , PERIPHERAL_TYPE_JOYSTICK , PERIPHERAL_TYPE_KEYBOARD , PERIPHERAL_TYPE_MOUSE }
 
enum  PERIPHERAL_EVENT_TYPE {
  PERIPHERAL_EVENT_TYPE_NONE , PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON , PERIPHERAL_EVENT_TYPE_DRIVER_HAT , PERIPHERAL_EVENT_TYPE_DRIVER_AXIS ,
  PERIPHERAL_EVENT_TYPE_SET_MOTOR
}
 
enum  JOYSTICK_STATE_BUTTON { JOYSTICK_STATE_BUTTON_UNPRESSED = 0x0 , JOYSTICK_STATE_BUTTON_PRESSED = 0x1 }
 
enum  JOYSTICK_STATE_HAT {
  JOYSTICK_STATE_HAT_UNPRESSED = 0x0 , JOYSTICK_STATE_HAT_LEFT = 0x1 , JOYSTICK_STATE_HAT_RIGHT = 0x2 , JOYSTICK_STATE_HAT_UP = 0x4 ,
  JOYSTICK_STATE_HAT_DOWN = 0x8 , JOYSTICK_STATE_HAT_LEFT_UP = JOYSTICK_STATE_HAT_LEFT | JOYSTICK_STATE_HAT_UP , JOYSTICK_STATE_HAT_LEFT_DOWN = JOYSTICK_STATE_HAT_LEFT | JOYSTICK_STATE_HAT_DOWN , JOYSTICK_STATE_HAT_RIGHT_UP = JOYSTICK_STATE_HAT_RIGHT | JOYSTICK_STATE_HAT_UP ,
  JOYSTICK_STATE_HAT_RIGHT_DOWN = JOYSTICK_STATE_HAT_RIGHT | JOYSTICK_STATE_HAT_DOWN
}
 
enum  JOYSTICK_DRIVER_PRIMITIVE_TYPE {
  JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN , JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON , JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION , JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS ,
  JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR , JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY , JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON , JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION
}
 
enum  JOYSTICK_DRIVER_HAT_DIRECTION {
  JOYSTICK_DRIVER_HAT_UNKNOWN , JOYSTICK_DRIVER_HAT_LEFT , JOYSTICK_DRIVER_HAT_RIGHT , JOYSTICK_DRIVER_HAT_UP ,
  JOYSTICK_DRIVER_HAT_DOWN
}
 
enum  JOYSTICK_DRIVER_SEMIAXIS_DIRECTION { JOYSTICK_DRIVER_SEMIAXIS_NEGATIVE = -1 , JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN = 0 , JOYSTICK_DRIVER_SEMIAXIS_POSITIVE = 1 }
 
enum  JOYSTICK_DRIVER_MOUSE_INDEX {
  JOYSTICK_DRIVER_MOUSE_INDEX_UNKNOWN , JOYSTICK_DRIVER_MOUSE_INDEX_LEFT , JOYSTICK_DRIVER_MOUSE_INDEX_RIGHT , JOYSTICK_DRIVER_MOUSE_INDEX_MIDDLE ,
  JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON4 , JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON5 , JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_UP , JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_DOWN ,
  JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_LEFT , JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_RIGHT
}
 
enum  JOYSTICK_DRIVER_RELPOINTER_DIRECTION {
  JOYSTICK_DRIVER_RELPOINTER_UNKNOWN , JOYSTICK_DRIVER_RELPOINTER_LEFT , JOYSTICK_DRIVER_RELPOINTER_RIGHT , JOYSTICK_DRIVER_RELPOINTER_UP ,
  JOYSTICK_DRIVER_RELPOINTER_DOWN
}
 
enum  JOYSTICK_FEATURE_TYPE {
  JOYSTICK_FEATURE_TYPE_UNKNOWN , JOYSTICK_FEATURE_TYPE_SCALAR , JOYSTICK_FEATURE_TYPE_ANALOG_STICK , JOYSTICK_FEATURE_TYPE_ACCELEROMETER ,
  JOYSTICK_FEATURE_TYPE_MOTOR , JOYSTICK_FEATURE_TYPE_RELPOINTER , JOYSTICK_FEATURE_TYPE_ABSPOINTER , JOYSTICK_FEATURE_TYPE_WHEEL ,
  JOYSTICK_FEATURE_TYPE_THROTTLE , JOYSTICK_FEATURE_TYPE_KEY
}
 
enum  JOYSTICK_FEATURE_PRIMITIVE {
  JOYSTICK_SCALAR_PRIMITIVE = 0 , JOYSTICK_ANALOG_STICK_UP = 0 , JOYSTICK_ANALOG_STICK_DOWN = 1 , JOYSTICK_ANALOG_STICK_RIGHT = 2 ,
  JOYSTICK_ANALOG_STICK_LEFT = 3 , JOYSTICK_ACCELEROMETER_POSITIVE_X = 0 , JOYSTICK_ACCELEROMETER_POSITIVE_Y = 1 , JOYSTICK_ACCELEROMETER_POSITIVE_Z = 2 ,
  JOYSTICK_MOTOR_PRIMITIVE = 0 , JOYSTICK_WHEEL_LEFT = 0 , JOYSTICK_WHEEL_RIGHT = 1 , JOYSTICK_THROTTLE_UP = 0 ,
  JOYSTICK_THROTTLE_DOWN = 1 , JOYSTICK_KEY_PRIMITIVE = 0 , JOYSTICK_MOUSE_BUTTON = 0 , JOYSTICK_RELPOINTER_UP = 0 ,
  JOYSTICK_RELPOINTER_DOWN = 1 , JOYSTICK_RELPOINTER_RIGHT = 2 , JOYSTICK_RELPOINTER_LEFT = 3 , JOYSTICK_PRIMITIVE_MAX = 4
}
 

Macro Definition Documentation

◆ DRIVER_INDEX_UNKNOWN

#define DRIVER_INDEX_UNKNOWN   (-1)

◆ NO_PORT_REQUESTED

#define NO_PORT_REQUESTED   (-1)

Typedef Documentation

◆ AddonInstance_Peripheral

typedef struct AddonInstance_Peripheral AddonInstance_Peripheral

◆ AddonProps_Peripheral

typedef struct AddonProps_Peripheral AddonProps_Peripheral

◆ AddonToKodiFuncTable_Peripheral

typedef struct AddonToKodiFuncTable_Peripheral AddonToKodiFuncTable_Peripheral

◆ JOYSTICK_DRIVER_BUTTON

typedef struct JOYSTICK_DRIVER_BUTTON JOYSTICK_DRIVER_BUTTON

Button primitive.

◆ JOYSTICK_DRIVER_HAT

typedef struct JOYSTICK_DRIVER_HAT JOYSTICK_DRIVER_HAT

Hat direction primitive.

◆ JOYSTICK_DRIVER_KEY

typedef struct JOYSTICK_DRIVER_KEY JOYSTICK_DRIVER_KEY

Keyboard key primitive.

◆ JOYSTICK_DRIVER_MOTOR

typedef struct JOYSTICK_DRIVER_MOTOR JOYSTICK_DRIVER_MOTOR

Motor primitive.

◆ JOYSTICK_DRIVER_MOUSE_BUTTON

typedef struct JOYSTICK_DRIVER_MOUSE_BUTTON JOYSTICK_DRIVER_MOUSE_BUTTON

Mouse button primitive.

◆ JOYSTICK_DRIVER_PRIMITIVE

typedef struct JOYSTICK_DRIVER_PRIMITIVE JOYSTICK_DRIVER_PRIMITIVE

Driver primitive struct.

◆ JOYSTICK_DRIVER_RELPOINTER

typedef struct JOYSTICK_DRIVER_RELPOINTER JOYSTICK_DRIVER_RELPOINTER

Relative pointer direction primitive.

◆ JOYSTICK_DRIVER_SEMIAXIS

typedef struct JOYSTICK_DRIVER_SEMIAXIS JOYSTICK_DRIVER_SEMIAXIS

Semiaxis primitive.

◆ JOYSTICK_FEATURE

typedef struct JOYSTICK_FEATURE JOYSTICK_FEATURE

Mapping between higher-level controller feature and its driver primitives.

◆ JOYSTICK_INFO

typedef struct JOYSTICK_INFO JOYSTICK_INFO

Info specific to joystick peripherals.

◆ KodiToAddonFuncTable_Peripheral

typedef struct KodiToAddonFuncTable_Peripheral KodiToAddonFuncTable_Peripheral
Todo
Mouse, light gun, multitouch

◆ PERIPHERAL_CAPABILITIES

typedef struct PERIPHERAL_CAPABILITIES PERIPHERAL_CAPABILITIES

Peripheral add-on capabilities.

◆ PERIPHERAL_EVENT

typedef struct PERIPHERAL_EVENT PERIPHERAL_EVENT

Event information.

◆ PERIPHERAL_INFO

typedef struct PERIPHERAL_INFO PERIPHERAL_INFO

Information shared between peripherals.