Joystick translation utilities.
More...
#include <JoystickTranslator.h>
Joystick translation utilities.
◆ GetPrimitiveName()
std::string CJoystickTranslator::GetPrimitiveName |
( |
const CDriverPrimitive & | primitive | ) |
|
|
static |
Get the localized name of the primitive.
- Parameters
-
primitive | The primitive, currently only buttons and axes are supported |
- Returns
- A title for the primitive, e.g. "Button 0" or "Axis 1"
◆ HatStateToString()
const char * CJoystickTranslator::HatStateToString |
( |
HAT_STATE | state | ) |
|
|
static |
Translate a hat state to a string representation.
- Parameters
-
- Returns
- A capitalized string representation, or "RELEASED" if the hat is centered.
◆ PositionToSemiAxisDirection()
Get the semi-axis direction containing the specified position.
- Parameters
-
position | The position of the axis |
- Returns
- POSITIVE, NEGATIVE, or UNKNOWN if position is 0
◆ PositionToThrottleDirection()
Get the throttle direction containing the specified position.
- Parameters
-
position | The position of the axis |
- Returns
- UP, DOWN, or UNKNOWN if position is 0
◆ PositionToWheelDirection()
WHEEL_DIRECTION CJoystickTranslator::PositionToWheelDirection |
( |
float | position | ) |
|
|
static |
Get the wheel direction containing the specified position.
- Parameters
-
position | The position of the axis |
- Returns
- LEFT, RIGHT, or UNKNOWN if position is 0
◆ TranslateAnalogStickDirection() [1/2]
Translate an analog stick direction to a lower-case string.
- Parameters
-
dir | The analog stick direction |
- Returns
- A lower-case string representation, or "" if the direction is invalid
◆ TranslateAnalogStickDirection() [2/2]
Translate an analog stick direction string to an enum value.
- Parameters
-
dir | The analog stick direction |
- Returns
- The translated direction, or ANALOG_STICK_DIRECTION::UNKNOWN if unknown
◆ TranslateThrottleDirection() [1/2]
THROTTLE_DIRECTION CJoystickTranslator::TranslateThrottleDirection |
( |
const std::string & | dir | ) |
|
|
static |
Translate a throttle direction string to an enum value.
- Parameters
-
dir | The throttle direction |
- Returns
- The translated direction, or THROTTLE_DIRECTION::UNKNOWN if unknown
◆ TranslateThrottleDirection() [2/2]
Translate a throttle direction to a lower-case string.
- Parameters
-
dir | The analog stick direction |
- Returns
- A lower-case string representation, or "" if the direction is invalid
◆ TranslateWheelDirection() [1/2]
WHEEL_DIRECTION CJoystickTranslator::TranslateWheelDirection |
( |
const std::string & | dir | ) |
|
|
static |
Translate a wheel direction string to an enum value.
- Parameters
-
- Returns
- The translated direction, or WHEEL_DIRECTION::UNKNOWN if unknown
◆ TranslateWheelDirection() [2/2]
const char * CJoystickTranslator::TranslateWheelDirection |
( |
WHEEL_DIRECTION | dir | ) |
|
|
static |
Translate a wheel direction to a lower-case string.
- Parameters
-
- Returns
- A lower-case string representation, or "" if the direction is invalid
The documentation for this class was generated from the following files: