9 #ifndef C_API_ADDONINSTANCE_PERIPHERAL_H
10 #define C_API_ADDONINSTANCE_PERIPHERAL_H
12 #include "../addon_base.h"
15 #define NO_PORT_REQUESTED (-1)
18 #define DRIVER_INDEX_UNKNOWN (-1)
102 bool provides_joystick_rumble;
103 bool provides_joystick_power_off;
611 KODI_HANDLE kodiInstance;
612 void (*trigger_scan)(
void* kodiInstance);
613 void (*refresh_button_maps)(
void* kodiInstance,
614 const char* device_name,
615 const char* controller_id);
616 unsigned int (*feature_count)(
void* kodiInstance,
617 const char* controller_id,
620 (
void* kodiInstance,
const char* controller_id,
const char* feature_name);
627 KODI_HANDLE addonInstance;
633 unsigned int* peripheral_count,
636 unsigned int peripheral_count,
640 unsigned int* event_count,
643 unsigned int event_count,
659 const char* controller_id,
660 unsigned int* feature_count,
663 unsigned int feature_count,
668 const char* controller_id,
669 unsigned int feature_count,
674 unsigned int* feature_count,
682 unsigned int primitive_count,
690 const char* controller_id);
JOYSTICK_STATE_BUTTON
Definition: peripheral.h:145
@ JOYSTICK_STATE_BUTTON_UNPRESSED
button is released
Definition: peripheral.h:147
@ JOYSTICK_STATE_BUTTON_PRESSED
button is pressed
Definition: peripheral.h:150
JOYSTICK_STATE_HAT
Definition: peripheral.h:162
@ JOYSTICK_STATE_HAT_DOWN
only down is pressed
Definition: peripheral.h:176
@ JOYSTICK_STATE_HAT_RIGHT
only right is pressed
Definition: peripheral.h:170
@ JOYSTICK_STATE_HAT_RIGHT_DOWN
right and down is pressed
Definition: peripheral.h:188
@ JOYSTICK_STATE_HAT_UNPRESSED
no directions are pressed
Definition: peripheral.h:164
@ JOYSTICK_STATE_HAT_LEFT
only left is pressed
Definition: peripheral.h:167
@ JOYSTICK_STATE_HAT_UP
only up is pressed
Definition: peripheral.h:173
@ JOYSTICK_STATE_HAT_LEFT_UP
left and up is pressed
Definition: peripheral.h:179
@ JOYSTICK_STATE_HAT_LEFT_DOWN
left and down is pressed
Definition: peripheral.h:182
@ JOYSTICK_STATE_HAT_RIGHT_UP
right and up is pressed
Definition: peripheral.h:185
PERIPHERAL_EVENT_TYPE
Definition: peripheral.h:119
@ PERIPHERAL_EVENT_TYPE_SET_MOTOR
set the state for joystick rumble motor
Definition: peripheral.h:133
@ PERIPHERAL_EVENT_TYPE_DRIVER_HAT
state changed for joystick driver hat
Definition: peripheral.h:127
@ PERIPHERAL_EVENT_TYPE_NONE
unknown event
Definition: peripheral.h:121
@ PERIPHERAL_EVENT_TYPE_DRIVER_AXIS
state changed for joystick driver axis
Definition: peripheral.h:130
@ PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON
state changed for joystick driver button
Definition: peripheral.h:124
float JOYSTICK_STATE_AXIS
Axis value in the closed interval [-1.0, 1.0].
Definition: peripheral.h:201
float JOYSTICK_STATE_MOTOR
Motor value in the closed interval [0.0, 1.0].
Definition: peripheral.h:207
PERIPHERAL_ERROR
Definition: peripheral.h:36
@ PERIPHERAL_ERROR_NOT_CONNECTED
-5 : No peripherals are connected
Definition: peripheral.h:53
@ PERIPHERAL_ERROR_FAILED
-2 : The command failed
Definition: peripheral.h:44
@ PERIPHERAL_ERROR_INVALID_PARAMETERS
-3 : The parameters of the method are invalid for this operation
Definition: peripheral.h:47
@ PERIPHERAL_ERROR_UNKNOWN
-1 : An unknown error occurred
Definition: peripheral.h:41
@ PERIPHERAL_NO_ERROR
0 : No error occurred
Definition: peripheral.h:38
@ PERIPHERAL_ERROR_NOT_IMPLEMENTED
-4 : The method that the frontend called is not implemented
Definition: peripheral.h:50
@ PERIPHERAL_ERROR_CONNECTION_FAILED
-6 : Peripherals are connected, but command was interrupted
Definition: peripheral.h:56
JOYSTICK_DRIVER_HAT_DIRECTION
Definition: peripheral.h:307
@ JOYSTICK_DRIVER_HAT_RIGHT
Driver hat right.
Definition: peripheral.h:315
@ JOYSTICK_DRIVER_HAT_DOWN
Driver hat down.
Definition: peripheral.h:321
@ JOYSTICK_DRIVER_HAT_UNKNOWN
Driver hat unknown.
Definition: peripheral.h:309
@ JOYSTICK_DRIVER_HAT_UP
Driver hat up.
Definition: peripheral.h:318
@ JOYSTICK_DRIVER_HAT_LEFT
Driver hat left.
Definition: peripheral.h:312
JOYSTICK_DRIVER_MOUSE_INDEX
Definition: peripheral.h:389
@ JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_DOWN
Mouse index wheel down.
Definition: peripheral.h:412
@ JOYSTICK_DRIVER_MOUSE_INDEX_LEFT
Mouse index left.
Definition: peripheral.h:394
@ JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON4
Mouse index button 4.
Definition: peripheral.h:403
@ JOYSTICK_DRIVER_MOUSE_INDEX_UNKNOWN
Mouse index unknown.
Definition: peripheral.h:391
@ JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_LEFT
Mouse index horizontal wheel left.
Definition: peripheral.h:415
@ JOYSTICK_DRIVER_MOUSE_INDEX_MIDDLE
Mouse index middle.
Definition: peripheral.h:400
@ JOYSTICK_DRIVER_MOUSE_INDEX_WHEEL_UP
Mouse index wheel up.
Definition: peripheral.h:409
@ JOYSTICK_DRIVER_MOUSE_INDEX_RIGHT
Mouse index right.
Definition: peripheral.h:397
@ JOYSTICK_DRIVER_MOUSE_INDEX_HORIZ_WHEEL_RIGHT
Mouse index horizontal wheel right.
Definition: peripheral.h:418
@ JOYSTICK_DRIVER_MOUSE_INDEX_BUTTON5
Mouse index button 5.
Definition: peripheral.h:406
JOYSTICK_DRIVER_PRIMITIVE_TYPE
Definition: peripheral.h:264
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR
Driver input primitive type motor.
Definition: peripheral.h:278
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON
Driver input primitive type mouse button.
Definition: peripheral.h:284
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN
Driver input primitive type unknown.
Definition: peripheral.h:266
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION
Driver input primitive type relative pointer direction.
Definition: peripheral.h:287
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION
Driver input primitive type hat direction.
Definition: peripheral.h:272
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON
Driver input primitive type button.
Definition: peripheral.h:269
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS
Driver input primitive type semiaxis.
Definition: peripheral.h:275
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY
Driver input primitive type key.
Definition: peripheral.h:281
JOYSTICK_DRIVER_RELPOINTER_DIRECTION
Definition: peripheral.h:438
@ JOYSTICK_DRIVER_RELPOINTER_RIGHT
Relative pointer direction right.
Definition: peripheral.h:446
@ JOYSTICK_DRIVER_RELPOINTER_LEFT
Relative pointer direction left.
Definition: peripheral.h:443
@ JOYSTICK_DRIVER_RELPOINTER_UP
Relative pointer direction up.
Definition: peripheral.h:449
@ JOYSTICK_DRIVER_RELPOINTER_UNKNOWN
Relative pointer direction unknown.
Definition: peripheral.h:440
@ JOYSTICK_DRIVER_RELPOINTER_DOWN
Relative pointer direction down.
Definition: peripheral.h:452
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION
Definition: peripheral.h:342
@ JOYSTICK_DRIVER_SEMIAXIS_NEGATIVE
negative half of the axis
Definition: peripheral.h:344
@ JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN
unknown direction
Definition: peripheral.h:347
@ JOYSTICK_DRIVER_SEMIAXIS_POSITIVE
positive half of the axis
Definition: peripheral.h:350
JOYSTICK_FEATURE_PRIMITIVE
Definition: peripheral.h:536
@ JOYSTICK_THROTTLE_UP
Throttle up.
Definition: peripheral.h:565
@ JOYSTICK_WHEEL_LEFT
Wheel left.
Definition: peripheral.h:560
@ JOYSTICK_RELPOINTER_DOWN
Relative pointer direction down.
Definition: peripheral.h:578
@ JOYSTICK_RELPOINTER_UP
Relative pointer direction up.
Definition: peripheral.h:576
@ JOYSTICK_SCALAR_PRIMITIVE
Scalar feature (a button, hat direction or semiaxis)
Definition: peripheral.h:538
@ JOYSTICK_ACCELEROMETER_POSITIVE_X
Accelerometer X.
Definition: peripheral.h:550
@ JOYSTICK_ACCELEROMETER_POSITIVE_Y
Accelerometer Y.
Definition: peripheral.h:552
@ JOYSTICK_ANALOG_STICK_DOWN
Analog stick down.
Definition: peripheral.h:543
@ JOYSTICK_THROTTLE_DOWN
Throttle down.
Definition: peripheral.h:567
@ JOYSTICK_KEY_PRIMITIVE
Key.
Definition: peripheral.h:570
@ JOYSTICK_ANALOG_STICK_UP
Analog stick up.
Definition: peripheral.h:541
@ JOYSTICK_RELPOINTER_LEFT
Relative pointer direction left.
Definition: peripheral.h:582
@ JOYSTICK_WHEEL_RIGHT
Wheel right.
Definition: peripheral.h:562
@ JOYSTICK_PRIMITIVE_MAX
Maximum number of primitives.
Definition: peripheral.h:585
@ JOYSTICK_MOTOR_PRIMITIVE
Motor.
Definition: peripheral.h:557
@ JOYSTICK_MOUSE_BUTTON
Mouse button.
Definition: peripheral.h:573
@ JOYSTICK_RELPOINTER_RIGHT
Relative pointer direction right.
Definition: peripheral.h:580
@ JOYSTICK_ANALOG_STICK_LEFT
Analog stick left.
Definition: peripheral.h:547
@ JOYSTICK_ANALOG_STICK_RIGHT
Analog stick right.
Definition: peripheral.h:545
@ JOYSTICK_ACCELEROMETER_POSITIVE_Z
Accelerometer Z.
Definition: peripheral.h:554
JOYSTICK_FEATURE_TYPE
Definition: peripheral.h:494
@ JOYSTICK_FEATURE_TYPE_ANALOG_STICK
Type analog stick.
Definition: peripheral.h:502
@ JOYSTICK_FEATURE_TYPE_RELPOINTER
Type relative pointer.
Definition: peripheral.h:511
@ JOYSTICK_FEATURE_TYPE_ACCELEROMETER
Type accelerometer.
Definition: peripheral.h:505
@ JOYSTICK_FEATURE_TYPE_WHEEL
Type wheel.
Definition: peripheral.h:517
@ JOYSTICK_FEATURE_TYPE_UNKNOWN
Unknown type.
Definition: peripheral.h:496
@ JOYSTICK_FEATURE_TYPE_MOTOR
Type motor.
Definition: peripheral.h:508
@ JOYSTICK_FEATURE_TYPE_ABSPOINTER
Type absolut pointer.
Definition: peripheral.h:514
@ JOYSTICK_FEATURE_TYPE_KEY
Type key.
Definition: peripheral.h:523
@ JOYSTICK_FEATURE_TYPE_THROTTLE
Type throttle.
Definition: peripheral.h:520
@ JOYSTICK_FEATURE_TYPE_SCALAR
Type scalar.
Definition: peripheral.h:499
PERIPHERAL_TYPE
Definition: peripheral.h:71
@ PERIPHERAL_TYPE_UNKNOWN
Type declared as unknown.
Definition: peripheral.h:73
@ PERIPHERAL_TYPE_JOYSTICK
Type declared as joystick.
Definition: peripheral.h:76
@ PERIPHERAL_TYPE_KEYBOARD
Type declared as keyboard.
Definition: peripheral.h:79
Definition: peripheral.h:697
Definition: peripheral.h:602
const char * addon_path
path to this add-on
Definition: peripheral.h:604
const char * user_path
path to the user profile
Definition: peripheral.h:603
Definition: peripheral.h:610
Button primitive.
Definition: peripheral.h:296
Hat direction primitive.
Definition: peripheral.h:330
Keyboard key primitive.
Definition: peripheral.h:378
Motor primitive.
Definition: peripheral.h:370
Mouse button primitive.
Definition: peripheral.h:427
Driver primitive struct.
Definition: peripheral.h:469
Relative pointer direction primitive.
Definition: peripheral.h:461
Semiaxis primitive.
Definition: peripheral.h:359
Mapping between higher-level controller feature and its driver primitives.
Definition: peripheral.h:594
Info specific to joystick peripherals.
Definition: peripheral.h:239
unsigned int motor_count
number of motors reported by the driver
Definition: peripheral.h:246
unsigned int axis_count
number of axes reported by the driver
Definition: peripheral.h:245
char * provider
name of the driver or interface providing the joystick
Definition: peripheral.h:241
unsigned int button_count
number of buttons reported by the driver
Definition: peripheral.h:243
bool supports_poweroff
whether the joystick supports being powered off
Definition: peripheral.h:247
unsigned int hat_count
number of hats reported by the driver
Definition: peripheral.h:244
PERIPHERAL_INFO peripheral
peripheral info for this joystick
Definition: peripheral.h:240
int requested_port
requested port number (such as for 360 controllers), or NO_PORT_REQUESTED
Definition: peripheral.h:242
Definition: peripheral.h:626
Peripheral add-on capabilities.
Definition: peripheral.h:100
bool provides_joysticks
Definition: peripheral.h:101
bool provides_buttonmaps
Definition: peripheral.h:104
Event information.
Definition: peripheral.h:214
unsigned int peripheral_index
Index of the peripheral handling/receiving the event.
Definition: peripheral.h:216
unsigned int driver_index
The index of the event source.
Definition: peripheral.h:222
PERIPHERAL_EVENT_TYPE type
Type of the event used to determine which enum field to access below.
Definition: peripheral.h:219
Information shared between peripherals.
Definition: peripheral.h:88
uint16_t product_id
Definition: peripheral.h:92
unsigned int index
Definition: peripheral.h:93
char * name
Definition: peripheral.h:90
uint16_t vendor_id
Definition: peripheral.h:91
PERIPHERAL_TYPE type
Definition: peripheral.h:89