Peripheral operations to handle control about.
Peripheral parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
Header parts:
Source parts:
Modules | |
Group header include | |
Group source include | |
|
inlinevirtual |
Get the list of features that this add-on provides.
Called by the frontend to query the add-on's capabilities and supported peripherals. All capabilities that the add-on supports should be set to true.
[out] | capabilities | The add-on's capabilities |
The following table contains values that can be set with class PeripheralCapabilities :
Name | Type | Set call | Get call |
---|---|---|---|
Provides joysticks | boolean | SetProvidesJoysticks | GetProvidesJoysticks |
Provides joystick rumble | boolean | SetProvidesJoystickRumble | GetProvidesJoystickRumble |
Provides joystick power off | boolean | SetProvidesJoystickPowerOff | GetProvidesJoystickPowerOff |
Provides button maps | boolean | SetProvidesButtonmaps | GetProvidesButtonmaps |
Example:
|
inlinevirtual |
Perform a scan for joysticks.
The frontend calls this when a hardware change is detected. If an add-on detects a hardware change, it can trigger this function using the TriggerScan() callback.
[in] | scan_results | Assigned to allocated memory |
The following table contains values that can be set with class Peripheral :
Name | Type | Set call | Get call |
---|---|---|---|
Peripheral type | PERIPHERAL_TYPE | SetType | Type |
Peripheral name | const std::string& | SetName | Name |
Peripheral vendor id | uint16_t | SetVendorID | VendorID |
Peripheral product id | uint16_t | SetProductID | ProductID |
Peripheral index | unsigned int | SetIndex | Index |
Further are following included:
|
inlinevirtual |
Get all events that have occurred since the last call to GetEvents().
[out] | events | List of available events within addon |
The following table contains values that can be set with class PeripheralEvent :
Name | Type | Set call | Get call |
---|---|---|---|
Peripheral event type | PERIPHERAL_EVENT_TYPE | SetType | Type |
Peripheral index | unsigned int | SetPeripheralIndex | PeripheralIndex |
Peripheral event driver index | unsigned int | SetDriverIndex | DriverIndex |
Peripheral event button state | JOYSTICK_STATE_BUTTON | SetButtonState | ButtonState |
Peripheral event hat state | JOYSTICK_STATE_HAT | SetHatState | HatState |
Peripheral event axis state | JOYSTICK_STATE_AXIS (float ) | SetAxisState | AxisState |
Peripheral event motor state | JOYSTICK_STATE_MOTOR (float ) | SetMotorState | MotorState |
Further are several class constructors with values included.
|
inlinevirtual |
Send an input event to the peripheral.
[in] | event | The input event |