|
stmm-input-doc
0.17.0
|
The joystick capability of a device. More...

Public Types | |
| enum | HAT_VALUE { HAT_VALUE_NOT_SET = -1, HAT_CENTER = 0, HAT_UP = 4, HAT_RIGHT = 2, HAT_DOWN = 8, HAT_LEFT = 1, HAT_RIGHTUP = (HAT_RIGHT | HAT_UP), HAT_RIGHTDOWN = (HAT_RIGHT | HAT_DOWN), HAT_LEFTUP = (HAT_LEFT | HAT_UP), HAT_LEFTDOWN = (HAT_LEFT | HAT_DOWN), HAT_CENTER_CANCEL = 16 } |
| The valid states of a hat. More... | |
| enum | BUTTON { BUTTON_TRIGGER = 0x120, BUTTON_THUMB = 0x121, BUTTON_THUMB2 = 0x122, BUTTON_TOP = 0x123, BUTTON_TOP2 = 0x124, BUTTON_PINKIE = 0x125, BUTTON_BASE = 0x126, BUTTON_A = 0x130, BUTTON_B = 0x131, BUTTON_C = 0x132, BUTTON_X = 0x133, BUTTON_Y = 0x134, BUTTON_Z = 0x135, BUTTON_TL = 0x136, BUTTON_TR = 0x137, BUTTON_TL2 = 0x138, BUTTON_TR2 = 0x139, BUTTON_SELECT = 0x13a, BUTTON_START = 0x13b, BUTTON_MODE = 0x13c, BUTTON_THUMBL = 0x13d, BUTTON_THUMBR = 0x13e, BUTTON_GEAR_DOWN = 0x150, BUTTON_GEAR_UP = 0x151 } |
| The valid buttons. More... | |
| enum | AXIS { AXIS_X = 0x00, AXIS_Y = 0x01, AXIS_Z = 0x02, AXIS_RX = 0x03, AXIS_RY = 0x04, AXIS_RZ = 0x05, AXIS_THROTTLE = 0x06, AXIS_RUDDER = 0x07, AXIS_WHEEL = 0x08, AXIS_GAS = 0x09, AXIS_BRAKE = 0x0a, AXIS_PRESSURE = 0x18, AXIS_DISTANCE = 0x19, AXIS_TILT_X = 0x1a, AXIS_TILT_Y = 0x1b } |
| The valid axes. More... | |
Public Member Functions | |
| virtual bool | hasButton (JoystickCapability::BUTTON eButton) const noexcept=0 |
| Whether a device implementing this capability has the given button. More... | |
| virtual int32_t | getTotHats () const noexcept=0 |
| The number of hats the device implementing this capability has. More... | |
| virtual bool | hasAxis (JoystickCapability::AXIS eAxis) const noexcept=0 |
| Whether a device implementing this capability has the given axis. More... | |
| virtual bool | isButtonPressed (JoystickCapability::BUTTON eButton) const noexcept=0 |
| Whether the given button is pressed. More... | |
| virtual HAT_VALUE | getHatValue (int32_t nHat) const noexcept=0 |
| The given hat value. More... | |
| virtual int32_t | getAxisValue (JoystickCapability::AXIS eAxis) const noexcept=0 |
| The given axis` value. More... | |
Public Member Functions inherited from stmi::Capability | |
| virtual | ~Capability () noexcept=default |
| int32_t | getId () const noexcept |
| The capability id. More... | |
| virtual shared_ptr< Device > | getDevice () const noexcept=0 |
| Returns the device owning this capability, if any. More... | |
| const Class & | getCapabilityClass () const noexcept |
| Get the registered class of the capability instance. More... | |
Static Public Member Functions | |
| static const std::vector< HAT_VALUE > & | getHatValues () noexcept |
Returns the defined HAT_VALUE values as an ordered vector (HAT_VALUE_NOT_SET excluded). More... | |
| static bool | isValidHatValue (HAT_VALUE eValue) noexcept |
| Tells whether a hat value is valid. More... | |
| static const std::vector< BUTTON > & | getButtons () noexcept |
| Returns the defined BUTTON values as an ordered vector. More... | |
| static bool | isValidButton (BUTTON eButton) noexcept |
| Tells whether a button value is valid. More... | |
| static const std::vector< AXIS > & | getAxes () noexcept |
| Returns the defined AXIS values as an ordered vector. More... | |
| static bool | isValidAxis (AXIS eAxis) noexcept |
| Tells whether an axis value is valid. More... | |
| static constexpr BUTTON | getMinButtonValue () noexcept |
| The minimal value of enum JoystickCapability::BUTTON. More... | |
| static constexpr BUTTON | getMaxButtonValue () noexcept |
| The maximal value of enum JoystickCapability::BUTTON. More... | |
| static constexpr AXIS | getMinAxisValue () noexcept |
| The minimal value of enum JoystickCapability::AXIS. More... | |
| static constexpr AXIS | getMaxAxisValue () noexcept |
| The maximal value of enum JoystickCapability::AXIS. More... | |
| static const Capability::Class & | getClass () noexcept |
Static Public Member Functions inherited from stmi::Capability | |
| static bool | isCapabilityClassIdRegistered (const std::string &sCapabilityClassId) noexcept |
| Tells whether the given capability class id is registered. More... | |
| static Class | getCapabilityClassIdClass (const std::string &sCapabilityClassId) noexcept |
| Gets the class with given class id. More... | |
Static Public Attributes | |
| static const char *const | s_sClassId |
Protected Member Functions | |
| JoystickCapability () noexcept | |
| Constructor. More... | |
Protected Member Functions inherited from stmi::Capability | |
| Capability (const Class &oClass) noexcept | |
| Constructor to be called from subclasses. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from stmi::Capability | |
| static bool | isCapabilityTypeRegistered (const std::type_info &oCapabilityType) noexcept |
| Tells whether a capability type was registered. More... | |
| static const std::type_info & | getCapabilityClassIdType (const std::string &sCapabilityClassId, bool &bRegistered) noexcept |
| Gets the type of the registered capability subclass associated with class id. More... | |
| static std::string | getCapabilityTypeClassId (const std::type_info &oType) noexcept |
| Gets the class id of the given type. More... | |
The joystick capability of a device.
Devices with this capability can generate joystick events.
The valid buttons.
|
inlineprotectednoexcept |
Constructor.
|
inlinestaticnoexcept |
Returns the defined AXIS values as an ordered vector.
The singleton vector is only created when this function is first called.
|
pure virtualnoexcept |
The given axis` value.
If the axis is not supported 0 is returned.
Implemented in stmi::testing::FakeJoystickCapability.
|
inlinestaticnoexcept |
Returns the defined BUTTON values as an ordered vector.
The singleton vector is only created when this function is first called.
|
inlinestaticnoexcept |
|
pure virtualnoexcept |
The given hat value.
Implemented in stmi::testing::FakeJoystickCapability.
|
inlinestaticnoexcept |
Returns the defined HAT_VALUE values as an ordered vector (HAT_VALUE_NOT_SET excluded).
The singleton vector is only created when this function is first called.
|
inlinestaticnoexcept |
The maximal value of enum JoystickCapability::AXIS.
|
inlinestaticnoexcept |
The maximal value of enum JoystickCapability::BUTTON.
|
inlinestaticnoexcept |
The minimal value of enum JoystickCapability::AXIS.
|
inlinestaticnoexcept |
The minimal value of enum JoystickCapability::BUTTON.
|
pure virtualnoexcept |
The number of hats the device implementing this capability has.
Implemented in stmi::testing::FakeJoystickCapability.
|
pure virtualnoexcept |
Whether a device implementing this capability has the given axis.
Implemented in stmi::testing::FakeJoystickCapability.
|
pure virtualnoexcept |
Whether a device implementing this capability has the given button.
Implemented in stmi::testing::FakeJoystickCapability.
|
pure virtualnoexcept |
Whether the given button is pressed.
If the button is not supported false is returned.
Implemented in stmi::testing::FakeJoystickCapability.
|
inlinestaticnoexcept |
Tells whether an axis value is valid.
| eAxis | The axis to check. |
|
inlinestaticnoexcept |
Tells whether a button value is valid.
| eButton | The button to check. |
|
inlinestaticnoexcept |
Tells whether a hat value is valid.
HAT_VALUE_NOT_SET is not considered a valid hat by this function!
| eValue | The hat to check. |
|
static |
1.8.13