Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Basic driver element associated with input events. More...
#include <DriverPrimitive.h>
Public Member Functions | |
CDriverPrimitive (void) | |
Construct an invalid driver primitive. | |
CDriverPrimitive (PRIMITIVE_TYPE type, unsigned int index) | |
Construct a driver primitive representing a button or motor. | |
CDriverPrimitive (unsigned int hatIndex, HAT_DIRECTION direction) | |
Construct a driver primitive representing one of the four direction arrows on a dpad. | |
CDriverPrimitive (unsigned int axisIndex, int center, SEMIAXIS_DIRECTION direction, unsigned int range) | |
Construct a driver primitive representing the positive or negative half of an axis. | |
CDriverPrimitive (KEYBOARD::XBMCKey keycode) | |
Construct a driver primitive representing a key on a keyboard. | |
CDriverPrimitive (MOUSE::BUTTON_ID index) | |
Construct a driver primitive representing a mouse button. | |
CDriverPrimitive (RELATIVE_POINTER_DIRECTION direction) | |
Construct a driver primitive representing a relative pointer. | |
bool | operator== (const CDriverPrimitive &rhs) const |
bool | operator< (const CDriverPrimitive &rhs) const |
bool | operator!= (const CDriverPrimitive &rhs) const |
bool | operator> (const CDriverPrimitive &rhs) const |
bool | operator<= (const CDriverPrimitive &rhs) const |
bool | operator>= (const CDriverPrimitive &rhs) const |
PRIMITIVE_TYPE | Type (void) const |
The type of driver primitive. | |
unsigned int | Index (void) const |
The index used by the joystick driver. | |
HAT_DIRECTION | HatDirection (void) const |
The direction arrow (valid for hat directions) | |
int | Center () const |
The location of the zero point of the semiaxis. | |
SEMIAXIS_DIRECTION | SemiAxisDirection (void) const |
The semiaxis direction (valid for semiaxes) | |
unsigned int | Range () const |
The distance between the center and the farthest valid value (valid for semiaxes) | |
KEYBOARD::XBMCKey | Keycode () const |
The keyboard symbol (valid for keys) | |
MOUSE::BUTTON_ID | MouseButton () const |
The mouse button ID (valid for mouse buttons) | |
RELATIVE_POINTER_DIRECTION | PointerDirection () const |
The relative pointer direction (valid for relative pointers) | |
bool | IsValid (void) const |
Test if an driver primitive is valid. | |
std::string | ToString () const |
Convert primitive to a string suitable for logging. | |
Basic driver element associated with input events.
Driver input (bools, floats and enums) is split into primitives that better map to the physical features on a joystick.
A bool obviously only maps to a single feature, so it is a driver primitive. Here, these are called "buttons".
A hat enum encodes the state of the four hat directions. Each direction can map to a different feature, so a hat enum consists of four driver primitives called "hat directions".
A float is a little trickier. Trivially, it can map to an analog stick or trigger. However, DirectInput combines two triggers onto a single axis. Therefore, the axis is split into two primitives called "semiaxes".
The type determines the fields in use:
Button:
Hat direction:
Semiaxis:
Motor:
Key:
Mouse button:
Relative pointer:
For more info, see "Chapter 2. Joystick drivers" in the documentation thread: http://forum.kodi.tv/showthread.php?tid=257764
|
default |
Construct an invalid driver primitive.
CDriverPrimitive::CDriverPrimitive | ( | PRIMITIVE_TYPE | type, |
unsigned int | index ) |
Construct a driver primitive representing a button or motor.
CDriverPrimitive::CDriverPrimitive | ( | unsigned int | hatIndex, |
HAT_DIRECTION | direction ) |
Construct a driver primitive representing one of the four direction arrows on a dpad.
CDriverPrimitive::CDriverPrimitive | ( | unsigned int | axisIndex, |
int | center, | ||
SEMIAXIS_DIRECTION | direction, | ||
unsigned int | range ) |
Construct a driver primitive representing the positive or negative half of an axis.
CDriverPrimitive::CDriverPrimitive | ( | KEYBOARD::XBMCKey | keycode | ) |
Construct a driver primitive representing a key on a keyboard.
CDriverPrimitive::CDriverPrimitive | ( | MOUSE::BUTTON_ID | index | ) |
Construct a driver primitive representing a mouse button.
CDriverPrimitive::CDriverPrimitive | ( | RELATIVE_POINTER_DIRECTION | direction | ) |
Construct a driver primitive representing a relative pointer.
|
inline |
The location of the zero point of the semiaxis.
|
inline |
The direction arrow (valid for hat directions)
The index used by the joystick driver.
Valid for:
Test if an driver primitive is valid.
A driver primitive is valid if it has a known type and:
1) for hats, it is a cardinal direction 2) for semi-axes, it is a positive or negative direction 3) for keys, the keycode is non-empty
|
inline |
The keyboard symbol (valid for keys)
|
inline |
The mouse button ID (valid for mouse buttons)
|
inline |
bool CDriverPrimitive::operator< | ( | const CDriverPrimitive & | rhs | ) | const |
|
inline |
bool CDriverPrimitive::operator== | ( | const CDriverPrimitive & | rhs | ) | const |
|
inline |
|
inline |
|
inline |
The relative pointer direction (valid for relative pointers)
|
inline |
The distance between the center and the farthest valid value (valid for semiaxes)
|
inline |
The semiaxis direction (valid for semiaxes)
std::string CDriverPrimitive::ToString | ( | ) | const |
Convert primitive to a string suitable for logging.
|
inline |
The type of driver primitive.