11#include "../../AddonBase.h"
12#include "../../c-api/addon-instance/peripheral.h"
23#define PERIPHERAL_SAFE_DELETE(x) \
29#define PERIPHERAL_SAFE_DELETE_ARRAY(x) \
41class CInstancePeripheral;
46template<
class THE_CLASS,
typename THE_STRUCT>
50 static void ToStructs(
const std::vector<THE_CLASS>& vecObjects, THE_STRUCT** pStructs)
55 if (vecObjects.empty())
61 (*pStructs) =
new THE_STRUCT[vecObjects.size()];
62 for (
unsigned int i = 0; i < vecObjects.size(); i++)
63 vecObjects.at(i).ToStruct((*pStructs)[i]);
67 static void ToStructs(
const std::vector<THE_CLASS*>& vecObjects, THE_STRUCT** pStructs)
72 if (vecObjects.empty())
78 *pStructs =
new THE_STRUCT[vecObjects.size()];
79 for (
unsigned int i = 0; i < vecObjects.size(); i++)
80 vecObjects.at(i)->ToStruct((*pStructs)[i]);
84 static void ToStructs(
const std::vector<std::shared_ptr<THE_CLASS>>& vecObjects,
85 THE_STRUCT** pStructs)
90 if (vecObjects.empty())
96 *pStructs =
new THE_STRUCT[vecObjects.size()];
97 for (
unsigned int i = 0; i < vecObjects.size(); i++)
98 vecObjects.at(i)->ToStruct((*pStructs)[i]);
102 static void FreeStructs(
unsigned int structCount, THE_STRUCT* structs)
106 for (
unsigned int i = 0; i < structCount; i++)
107 THE_CLASS::FreeStruct(structs[i]);
109 PERIPHERAL_SAFE_DELETE_ARRAY(structs);
143 m_cStructure->provides_joystick_rumble =
false;
144 m_cStructure->provides_joystick_power_off =
false;
178 m_cStructure->provides_joystick_rumble = providesJoystickRumble;
187 m_cStructure->provides_joystick_power_off = providesJoystickPowerOff;
254 : m_type(type), m_strName(strName)
268 return m_type == rhs.m_type &&
269 m_strName == rhs.m_strName &&
270 m_vendorId == rhs.m_vendorId &&
271 m_productId == rhs.m_productId;
283 const std::string&
Name(
void)
const {
return m_strName; }
288 uint16_t
VendorID(
void)
const {
return m_vendorId; }
298 unsigned int Index(
void)
const {
return m_index; }
305 bool IsVidPidKnown(
void)
const {
return m_vendorId != 0 || m_productId != 0; }
315 void SetName(
const std::string& strName) { m_strName = strName; }
330 void SetIndex(
unsigned int index) { m_index = index; }
336 m_strName(info.name ? info.name :
""),
337 m_vendorId(info.vendor_id),
338 m_productId(info.product_id),
346 info.name =
new char[m_strName.size() + 1];
347 info.vendor_id = m_vendorId;
348 info.product_id = m_productId;
349 info.index = m_index;
351 std::strcpy(info.name, m_strName.c_str());
354 static void FreeStruct(
PERIPHERAL_INFO& info) { PERIPHERAL_SAFE_DELETE_ARRAY(info.name); }
358 std::string m_strName;
359 uint16_t m_vendorId = 0;
360 uint16_t m_productId = 0;
361 unsigned int m_index = 0;
366typedef PeripheralVector<Peripheral, PERIPHERAL_INFO> Peripherals;
414 unsigned int buttonIndex,
417 m_peripheralIndex(peripheralIndex),
418 m_driverIndex(buttonIndex),
430 m_peripheralIndex(peripheralIndex),
431 m_driverIndex(hatIndex),
443 m_peripheralIndex(peripheralIndex),
444 m_driverIndex(axisIndex),
522 : m_type(event.type),
523 m_peripheralIndex(event.peripheral_index),
524 m_driverIndex(event.driver_index),
525 m_buttonState(event.driver_button_state),
526 m_hatState(event.driver_hat_state),
527 m_axisState(event.driver_axis_state),
528 m_motorState(event.motor_state)
535 event.peripheral_index = m_peripheralIndex;
536 event.driver_index = m_driverIndex;
537 event.driver_button_state = m_buttonState;
538 event.driver_hat_state = m_hatState;
539 event.driver_axis_state = m_axisState;
540 event.motor_state = m_motorState;
547 unsigned int m_peripheralIndex = 0;
548 unsigned int m_driverIndex = 0;
557typedef PeripheralVector<PeripheralEvent, PERIPHERAL_EVENT> PeripheralEvents;
618 Joystick(
const std::string& provider =
"",
const std::string& strName =
"")
620 m_provider(provider),
621 m_requestedPort(NO_PORT_REQUESTED)
641 Peripheral::operator=(rhs);
643 m_provider = rhs.m_provider;
644 m_requestedPort = rhs.m_requestedPort;
645 m_buttonCount = rhs.m_buttonCount;
646 m_hatCount = rhs.m_hatCount;
647 m_axisCount = rhs.m_axisCount;
648 m_motorCount = rhs.m_motorCount;
649 m_supportsPowerOff = rhs.m_supportsPowerOff;
659 m_provider == rhs.m_provider &&
660 m_requestedPort == rhs.m_requestedPort &&
661 m_buttonCount == rhs.m_buttonCount &&
662 m_hatCount == rhs.m_hatCount &&
663 m_axisCount == rhs.m_axisCount &&
664 m_motorCount == rhs.m_motorCount &&
665 m_supportsPowerOff == rhs.m_supportsPowerOff;
672 const std::string&
Provider(
void)
const {
return m_provider; }
687 unsigned int HatCount(
void)
const {
return m_hatCount; }
692 unsigned int AxisCount(
void)
const {
return m_axisCount; }
707 void SetProvider(
const std::string& provider) { m_provider = provider; }
722 void SetHatCount(
unsigned int hatCount) { m_hatCount = hatCount; }
743 m_provider(info.provider ? info.provider :
""),
744 m_requestedPort(info.requested_port),
745 m_buttonCount(info.button_count),
746 m_hatCount(info.hat_count),
747 m_axisCount(info.axis_count),
748 m_motorCount(info.motor_count),
749 m_supportsPowerOff(info.supports_poweroff)
755 Peripheral::ToStruct(info.peripheral);
757 info.provider =
new char[m_provider.size() + 1];
758 info.requested_port = m_requestedPort;
759 info.button_count = m_buttonCount;
760 info.hat_count = m_hatCount;
761 info.axis_count = m_axisCount;
762 info.motor_count = m_motorCount;
763 info.supports_poweroff = m_supportsPowerOff;
765 std::strcpy(info.provider, m_provider.c_str());
770 Peripheral::FreeStruct(info.peripheral);
772 PERIPHERAL_SAFE_DELETE_ARRAY(info.provider);
776 std::string m_provider;
778 unsigned int m_buttonCount = 0;
779 unsigned int m_hatCount = 0;
780 unsigned int m_axisCount = 0;
781 unsigned int m_motorCount = 0;
782 bool m_supportsPowerOff =
false;
787typedef PeripheralVector<Joystick, JOYSTICK_INFO> Joysticks;
789class JoystickFeature;
841 : m_type(type), m_driverIndex(driverIndex)
868 m_driverIndex(hatIndex),
869 m_hatDirection(direction)
885 m_driverIndex(axisIndex),
887 m_semiAxisDirection(direction),
916 static_cast<unsigned int>(buttonIndex));
946 int Center(
void)
const {
return m_center; }
956 unsigned int Range(
void)
const {
return m_range; }
961 const std::string&
Keycode(
void)
const {
return m_keycode; }
976 return m_relPointerDirection;
985 if (m_type == other.m_type)
991 return m_driverIndex == other.m_driverIndex;
995 return m_driverIndex == other.m_driverIndex && m_hatDirection == other.m_hatDirection;
999 return m_driverIndex == other.m_driverIndex && m_center == other.m_center &&
1000 m_semiAxisDirection == other.m_semiAxisDirection && m_range == other.m_range;
1004 return m_keycode == other.m_keycode;
1008 return m_driverIndex == other.m_driverIndex;
1012 return m_driverIndex == other.m_driverIndex;
1016 return m_relPointerDirection == other.m_relPointerDirection;
1033 m_driverIndex = primitive.button.index;
1038 m_driverIndex = primitive.hat.index;
1039 m_hatDirection = primitive.hat.direction;
1044 m_driverIndex = primitive.semiaxis.index;
1045 m_center = primitive.semiaxis.center;
1046 m_semiAxisDirection = primitive.semiaxis.direction;
1047 m_range = primitive.semiaxis.range;
1052 m_driverIndex = primitive.motor.index;
1057 m_keycode = primitive.key.keycode;
1062 m_driverIndex = primitive.mouse.button;
1067 m_relPointerDirection = primitive.relpointer.direction;
1077 driver_primitive.type = m_type;
1082 driver_primitive.button.index = m_driverIndex;
1087 driver_primitive.hat.index = m_driverIndex;
1088 driver_primitive.hat.direction = m_hatDirection;
1093 driver_primitive.semiaxis.index = m_driverIndex;
1094 driver_primitive.semiaxis.center = m_center;
1095 driver_primitive.semiaxis.direction = m_semiAxisDirection;
1096 driver_primitive.semiaxis.range = m_range;
1101 driver_primitive.motor.index = m_driverIndex;
1106 const size_t size =
sizeof(driver_primitive.key.keycode);
1107 std::strncpy(driver_primitive.key.keycode, m_keycode.c_str(), size - 1);
1108 driver_primitive.key.keycode[size - 1] =
'\0';
1118 driver_primitive.relpointer.direction = m_relPointerDirection;
1130 unsigned int m_driverIndex = 0;
1134 unsigned int m_range = 1;
1135 std::string m_keycode;
1141typedef PeripheralVector<DriverPrimitive, JOYSTICK_DRIVER_PRIMITIVE> DriverPrimitives;
1181 : m_name(name), m_type(type), m_primitives{}
1197 m_name = rhs.m_name;
1198 m_type = rhs.m_type;
1199 m_primitives = rhs.m_primitives;
1210 return m_name == other.m_name && m_type == other.m_type && m_primitives == other.m_primitives;
1216 const std::string&
Name(
void)
const {
return m_name; }
1231 void SetName(
const std::string& name) { m_name = name; }
1247 return m_primitives[which];
1256 m_primitives[which] = primitive;
1262 std::array<DriverPrimitive, JOYSTICK_PRIMITIVE_MAX>&
Primitives() {
return m_primitives; }
1267 const std::array<DriverPrimitive, JOYSTICK_PRIMITIVE_MAX>&
Primitives()
const
1269 return m_primitives;
1275 : m_name(feature.name ? feature.name :
""), m_type(feature.type)
1283 feature.name =
new char[m_name.length() + 1];
1284 feature.type = m_type;
1286 m_primitives[i].ToStruct(feature.primitives[i]);
1288 std::strcpy(feature.name, m_name.c_str());
1291 static void FreeStruct(
JOYSTICK_FEATURE& feature) { PERIPHERAL_SAFE_DELETE_ARRAY(feature.name); }
1296 std::array<DriverPrimitive, JOYSTICK_PRIMITIVE_MAX> m_primitives;
1301typedef PeripheralVector<JoystickFeature, JOYSTICK_FEATURE> JoystickFeatures;
Definition Peripheral.h:210
Definition AddonBase.h:206
Definition PeripheralUtils.h:1169
Definition PeripheralUtils.h:583
Definition PeripheralUtils.h:133
Definition PeripheralUtils.h:383
Definition PeripheralUtils.h:225
Definition PeripheralUtils.h:48
JOYSTICK_STATE_BUTTON
Definition peripheral.h:148
@ JOYSTICK_STATE_BUTTON_UNPRESSED
button is released
Definition peripheral.h:150
JOYSTICK_STATE_HAT
Definition peripheral.h:165
@ JOYSTICK_STATE_HAT_UNPRESSED
no directions are pressed
Definition peripheral.h:167
PERIPHERAL_EVENT_TYPE
Definition peripheral.h:122
@ PERIPHERAL_EVENT_TYPE_DRIVER_HAT
state changed for joystick driver hat
Definition peripheral.h:130
@ PERIPHERAL_EVENT_TYPE_NONE
unknown event
Definition peripheral.h:124
@ PERIPHERAL_EVENT_TYPE_DRIVER_AXIS
state changed for joystick driver axis
Definition peripheral.h:133
@ PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON
state changed for joystick driver button
Definition peripheral.h:127
float JOYSTICK_STATE_AXIS
Axis value in the closed interval [-1.0, 1.0].
Definition peripheral.h:204
float JOYSTICK_STATE_MOTOR
Motor value in the closed interval [0.0, 1.0].
Definition peripheral.h:210
DriverPrimitive(void)=default
Construct an invalid driver primitive.
bool operator==(const DriverPrimitive &other) const
Compare this with another class of this type.
Definition PeripheralUtils.h:983
static DriverPrimitive CreateMouseButton(JOYSTICK_DRIVER_MOUSE_INDEX buttonIndex)
Construct a driver primitive representing a mouse button.
Definition PeripheralUtils.h:913
DriverPrimitive(std::string keycode)
Construct a driver primitive representing a key on a keyboard.
Definition PeripheralUtils.h:904
static DriverPrimitive CreateButton(unsigned int buttonIndex)
Construct a driver primitive representing a joystick button.
Definition PeripheralUtils.h:856
DriverPrimitive(unsigned int axisIndex, int center, JOYSTICK_DRIVER_SEMIAXIS_DIRECTION direction, unsigned int range)
Construct a driver primitive representing the positive or negative half of an axis.
Definition PeripheralUtils.h:880
unsigned int Range(void) const
Get range.
Definition PeripheralUtils.h:956
JOYSTICK_DRIVER_HAT_DIRECTION HatDirection(void) const
Get hat direction.
Definition PeripheralUtils.h:941
DriverPrimitive(JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction)
Construct a driver primitive representing one of the four direction in which a relative pointer can m...
Definition PeripheralUtils.h:923
int Center(void) const
Get center.
Definition PeripheralUtils.h:946
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION SemiAxisDirection(void) const
Get semi axis direction.
Definition PeripheralUtils.h:951
JOYSTICK_DRIVER_RELPOINTER_DIRECTION RelPointerDirection(void) const
Get relative pointer direction.
Definition PeripheralUtils.h:974
static DriverPrimitive CreateMotor(unsigned int motorIndex)
Construct a driver primitive representing a motor.
Definition PeripheralUtils.h:896
JOYSTICK_DRIVER_MOUSE_INDEX MouseIndex(void) const
Get mouse index.
Definition PeripheralUtils.h:966
const std::string & Keycode(void) const
Get key code as string.
Definition PeripheralUtils.h:961
DriverPrimitive(unsigned int hatIndex, JOYSTICK_DRIVER_HAT_DIRECTION direction)
Construct a driver primitive representing one of the four direction arrows on a dpad.
Definition PeripheralUtils.h:866
unsigned int DriverIndex(void) const
Get driver index.
Definition PeripheralUtils.h:936
JOYSTICK_DRIVER_PRIMITIVE_TYPE Type(void) const
Get type of primitive.
Definition PeripheralUtils.h:931
JOYSTICK_DRIVER_HAT_DIRECTION
Definition peripheral.h:310
@ JOYSTICK_DRIVER_HAT_UNKNOWN
Driver hat unknown.
Definition peripheral.h:312
JOYSTICK_DRIVER_MOUSE_INDEX
Definition peripheral.h:392
JOYSTICK_DRIVER_PRIMITIVE_TYPE
Definition peripheral.h:267
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR
Driver input primitive type motor.
Definition peripheral.h:281
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOUSE_BUTTON
Driver input primitive type mouse button.
Definition peripheral.h:287
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN
Driver input primitive type unknown.
Definition peripheral.h:269
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_RELPOINTER_DIRECTION
Driver input primitive type relative pointer direction.
Definition peripheral.h:290
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION
Driver input primitive type hat direction.
Definition peripheral.h:275
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON
Driver input primitive type button.
Definition peripheral.h:272
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS
Driver input primitive type semiaxis.
Definition peripheral.h:278
@ JOYSTICK_DRIVER_PRIMITIVE_TYPE_KEY
Driver input primitive type key.
Definition peripheral.h:284
JOYSTICK_DRIVER_RELPOINTER_DIRECTION
Definition peripheral.h:441
@ JOYSTICK_DRIVER_RELPOINTER_UNKNOWN
Relative pointer direction unknown.
Definition peripheral.h:443
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION
Definition peripheral.h:345
@ JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN
unknown direction
Definition peripheral.h:350
JOYSTICK_FEATURE_PRIMITIVE
Definition peripheral.h:539
@ JOYSTICK_PRIMITIVE_MAX
Maximum number of primitives.
Definition peripheral.h:588
JOYSTICK_FEATURE_TYPE
Definition peripheral.h:497
@ JOYSTICK_FEATURE_TYPE_UNKNOWN
Unknown type.
Definition peripheral.h:499
std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & Primitives()
Get all primitives on this class.
Definition PeripheralUtils.h:1262
void SetType(JOYSTICK_FEATURE_TYPE type)
Set type of feature.
Definition PeripheralUtils.h:1236
void SetInvalid(void)
Set type as invalid.
Definition PeripheralUtils.h:1239
JoystickFeature & operator=(const JoystickFeature &rhs)
Copy data from another JoystickFeature class to here.
Definition PeripheralUtils.h:1193
const DriverPrimitive & Primitive(JOYSTICK_FEATURE_PRIMITIVE which) const
Get primitive of feature by wanted type.
Definition PeripheralUtils.h:1245
const std::string & Name(void) const
Get name of feature.
Definition PeripheralUtils.h:1216
JOYSTICK_FEATURE_TYPE Type(void) const
Get name of feature.
Definition PeripheralUtils.h:1221
void SetPrimitive(JOYSTICK_FEATURE_PRIMITIVE which, const DriverPrimitive &primitive)
Set primitive for feature by wanted type.
Definition PeripheralUtils.h:1254
void SetName(const std::string &name)
Set name of feature.
Definition PeripheralUtils.h:1231
const std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & Primitives() const
Get all primitives on this class (as constant).
Definition PeripheralUtils.h:1267
bool operator==(const JoystickFeature &other) const
Compare this with another class of this type.
Definition PeripheralUtils.h:1208
bool IsValid() const
Check this feature is valid.
Definition PeripheralUtils.h:1226
JoystickFeature(const std::string &name="", JOYSTICK_FEATURE_TYPE type=JOYSTICK_FEATURE_TYPE_UNKNOWN)
Class constructor.
Definition PeripheralUtils.h:1179
JoystickFeature(const JoystickFeature &other)
Class copy constructor.
Definition PeripheralUtils.h:1188
void SetMotorCount(unsigned int motorCount)
Get motor count.
Definition PeripheralUtils.h:732
const std::string & Provider(void) const
Get provider name.
Definition PeripheralUtils.h:672
Joystick & operator=(const Joystick &rhs)
Copy data from another Joystick class to here.
Definition PeripheralUtils.h:637
unsigned int ButtonCount(void) const
Get button count.
Definition PeripheralUtils.h:682
unsigned int HatCount(void) const
Get hat count.
Definition PeripheralUtils.h:687
Joystick(const Joystick &other)
Class copy constructor.
Definition PeripheralUtils.h:628
bool SupportsPowerOff(void) const
Get supports power off.
Definition PeripheralUtils.h:702
bool operator==(const Joystick &rhs) const
Comparison operator.
Definition PeripheralUtils.h:655
void SetButtonCount(unsigned int buttonCount)
Get button count.
Definition PeripheralUtils.h:717
int RequestedPort(void) const
Get requested port number.
Definition PeripheralUtils.h:677
void SetSupportsPowerOff(bool supportsPowerOff)
Get supports power off.
Definition PeripheralUtils.h:737
void SetProvider(const std::string &provider)
Set provider name.
Definition PeripheralUtils.h:707
void SetRequestedPort(int requestedPort)
Get requested port number.
Definition PeripheralUtils.h:712
Joystick(const std::string &provider="", const std::string &strName="")
Constructor.
Definition PeripheralUtils.h:618
unsigned int AxisCount(void) const
Get axis count.
Definition PeripheralUtils.h:692
void SetAxisCount(unsigned int axisCount)
Get axis count.
Definition PeripheralUtils.h:727
void SetHatCount(unsigned int hatCount)
Get hat count.
Definition PeripheralUtils.h:722
unsigned int MotorCount(void) const
Get motor count.
Definition PeripheralUtils.h:697
~Joystick(void) override=default
Destructor.
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
void SetType(PERIPHERAL_EVENT_TYPE type)
Set type of event.
Definition PeripheralUtils.h:487
JOYSTICK_STATE_HAT HatState(void) const
Get hat state.
Definition PeripheralUtils.h:472
void SetAxisState(JOYSTICK_STATE_AXIS state)
Set axis state.
Definition PeripheralUtils.h:512
JOYSTICK_STATE_MOTOR MotorState(void) const
Get motor state.
Definition PeripheralUtils.h:482
JOYSTICK_STATE_BUTTON ButtonState(void) const
Get button state.
Definition PeripheralUtils.h:467
PeripheralEvent(unsigned int peripheralIndex, unsigned int hatIndex, JOYSTICK_STATE_HAT state)
Constructor.
Definition PeripheralUtils.h:428
void SetDriverIndex(unsigned int index)
Set driver index.
Definition PeripheralUtils.h:497
PeripheralEvent()=default
Constructor.
unsigned int PeripheralIndex(void) const
Get peripheral index.
Definition PeripheralUtils.h:457
void SetPeripheralIndex(unsigned int index)
Set peripheral index.
Definition PeripheralUtils.h:492
void SetHatState(JOYSTICK_STATE_HAT state)
Set hat state.
Definition PeripheralUtils.h:507
JOYSTICK_STATE_AXIS AxisState(void) const
Get axis state.
Definition PeripheralUtils.h:477
PERIPHERAL_EVENT_TYPE Type(void) const
Get type of event.
Definition PeripheralUtils.h:452
void SetMotorState(JOYSTICK_STATE_MOTOR state)
Set motor state.
Definition PeripheralUtils.h:517
PeripheralEvent(unsigned int peripheralIndex, unsigned int buttonIndex, JOYSTICK_STATE_BUTTON state)
Constructor.
Definition PeripheralUtils.h:413
PeripheralEvent(unsigned int peripheralIndex, unsigned int axisIndex, JOYSTICK_STATE_AXIS state)
Constructor.
Definition PeripheralUtils.h:441
void SetButtonState(JOYSTICK_STATE_BUTTON state)
Set button state.
Definition PeripheralUtils.h:502
unsigned int DriverIndex(void) const
Get driver index.
Definition PeripheralUtils.h:462
uint16_t VendorID(void) const
Get peripheral vendor id.
Definition PeripheralUtils.h:288
void SetName(const std::string &strName)
Set peripheral name.
Definition PeripheralUtils.h:315
uint16_t ProductID(void) const
Get peripheral product id.
Definition PeripheralUtils.h:293
void SetIndex(unsigned int index)
Set peripheral index.
Definition PeripheralUtils.h:330
const std::string & Name(void) const
Get peripheral name.
Definition PeripheralUtils.h:283
virtual ~Peripheral(void)=default
Destructor.
bool IsVidPidKnown(void) const
Check VID and PID are known.
Definition PeripheralUtils.h:305
void SetType(PERIPHERAL_TYPE type)
Set peripheral type.
Definition PeripheralUtils.h:310
Peripheral(PERIPHERAL_TYPE type=PERIPHERAL_TYPE_UNKNOWN, const std::string &strName="")
Constructor.
Definition PeripheralUtils.h:253
void SetProductID(uint16_t productId)
Set peripheral product identifier.
Definition PeripheralUtils.h:325
bool operator==(const Peripheral &rhs) const
Comparison operator.
Definition PeripheralUtils.h:265
unsigned int Index(void) const
Get peripheral index identifier.
Definition PeripheralUtils.h:298
PERIPHERAL_TYPE Type(void) const
Get peripheral type.
Definition PeripheralUtils.h:278
void SetVendorID(uint16_t vendorId)
Set peripheral vendor id.
Definition PeripheralUtils.h:320
void SetProvidesJoystickPowerOff(bool providesJoystickPowerOff)
Set true if the add-on provides power off about joystick.
Definition PeripheralUtils.h:185
bool GetProvidesJoysticks() const
To get with SetProvidesJoysticks changed values.
Definition PeripheralUtils.h:173
void SetProvidesButtonmaps(bool providesButtonmaps)
Set true if the add-on provides button maps.
Definition PeripheralUtils.h:194
bool GetProvidesButtonmaps() const
To get with SetProvidesButtonmaps changed values.
Definition PeripheralUtils.h:200
bool GetProvidesJoystickPowerOff() const
To get with SetProvidesJoystickPowerOff changed values.
Definition PeripheralUtils.h:191
bool GetProvidesJoystickRumble() const
To get with SetProvidesJoystickRumble changed values.
Definition PeripheralUtils.h:182
void SetProvidesJoysticks(bool providesJoysticks)
Set true if the add-on provides joysticks.
Definition PeripheralUtils.h:167
void SetProvidesJoystickRumble(bool providesJoystickRumble)
Set true if the add-on provides joystick rumble.
Definition PeripheralUtils.h:176
Driver primitive struct.
Definition peripheral.h:472
Mapping between higher-level controller feature and its driver primitives.
Definition peripheral.h:597
Info specific to joystick peripherals.
Definition peripheral.h:242
Peripheral add-on capabilities.
Definition peripheral.h:103
bool provides_joysticks
Definition peripheral.h:104
bool provides_buttonmaps
Definition peripheral.h:107
Event information.
Definition peripheral.h:217
Information shared between peripherals.
Definition peripheral.h:91
Definition PeripheralUtils.h:835
DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE type, unsigned int driverIndex)
Construct a driver primitive of the specified type.
Definition PeripheralUtils.h:840