Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Base class for joystick driver primitives More...

Classes

struct  kodi::addon::DriverPrimitive
 

Functions

 kodi::addon::DriverPrimitive::DriverPrimitive (void)=default
 Construct an invalid driver primitive.
 
static DriverPrimitive kodi::addon::DriverPrimitive::CreateButton (unsigned int buttonIndex)
 Construct a driver primitive representing a joystick button.
 
 kodi::addon::DriverPrimitive::DriverPrimitive (unsigned int hatIndex, JOYSTICK_DRIVER_HAT_DIRECTION direction)
 Construct a driver primitive representing one of the four direction arrows on a dpad.
 
 kodi::addon::DriverPrimitive::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.
 
static DriverPrimitive kodi::addon::DriverPrimitive::CreateMotor (unsigned int motorIndex)
 Construct a driver primitive representing a motor.
 
 kodi::addon::DriverPrimitive::DriverPrimitive (std::string keycode)
 Construct a driver primitive representing a key on a keyboard.
 
static DriverPrimitive kodi::addon::DriverPrimitive::CreateMouseButton (JOYSTICK_DRIVER_MOUSE_INDEX buttonIndex)
 Construct a driver primitive representing a mouse button.
 
 kodi::addon::DriverPrimitive::DriverPrimitive (JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction)
 Construct a driver primitive representing one of the four direction in which a relative pointer can move.
 
JOYSTICK_DRIVER_PRIMITIVE_TYPE kodi::addon::DriverPrimitive::Type (void) const
 Get type of primitive.
 
unsigned int kodi::addon::DriverPrimitive::DriverIndex (void) const
 Get driver index.
 
JOYSTICK_DRIVER_HAT_DIRECTION kodi::addon::DriverPrimitive::HatDirection (void) const
 Get hat direction.
 
int kodi::addon::DriverPrimitive::Center (void) const
 Get center.
 
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION kodi::addon::DriverPrimitive::SemiAxisDirection (void) const
 Get semi axis direction.
 
unsigned int kodi::addon::DriverPrimitive::Range (void) const
 Get range.
 
const std::string & kodi::addon::DriverPrimitive::Keycode (void) const
 Get key code as string.
 
JOYSTICK_DRIVER_MOUSE_INDEX kodi::addon::DriverPrimitive::MouseIndex (void) const
 Get mouse index.
 
JOYSTICK_DRIVER_RELPOINTER_DIRECTION kodi::addon::DriverPrimitive::RelPointerDirection (void) const
 Get relative pointer direction.
 
bool kodi::addon::DriverPrimitive::operator== (const DriverPrimitive &other) const
 Compare this with another class of this type.
 

Detailed Description

Base class for joystick driver primitives

A driver primitive can be:

  1. a button
  2. a hat direction
  3. a semiaxis (either the positive or negative half of an axis)
  4. a motor
  5. a keyboard key
  6. a mouse button
  7. a relative pointer direction

The type determines the fields in use:

Button:

Hat direction:

Semiaxis:

Motor:

Key:

Mouse button:

Relative pointer direction:

Function Documentation

◆ Center()

int kodi::addon::DriverPrimitive::Center ( void ) const
inline

Get center.

Returns
Center

◆ CreateButton()

static DriverPrimitive kodi::addon::DriverPrimitive::CreateButton ( unsigned int buttonIndex)
inlinestatic

Construct a driver primitive representing a joystick button.

Parameters
[in]buttonIndexIndex
Returns
Created class

◆ CreateMotor()

static DriverPrimitive kodi::addon::DriverPrimitive::CreateMotor ( unsigned int motorIndex)
inlinestatic

Construct a driver primitive representing a motor.

Parameters
[in]motorIndexMotor index number
Returns
Constructed driver primitive representing a motor

◆ CreateMouseButton()

static DriverPrimitive kodi::addon::DriverPrimitive::CreateMouseButton ( JOYSTICK_DRIVER_MOUSE_INDEX buttonIndex)
inlinestatic

Construct a driver primitive representing a mouse button.

Parameters
[in]buttonIndexIndex
Returns
Constructed driver primitive representing a mouse button

◆ DriverIndex()

unsigned int kodi::addon::DriverPrimitive::DriverIndex ( void ) const
inline

Get driver index.

Returns
Index number

◆ DriverPrimitive() [1/5]

kodi::addon::DriverPrimitive::DriverPrimitive ( JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction)
inline

Construct a driver primitive representing one of the four direction in which a relative pointer can move.

Parameters
[in]directionWith JOYSTICK_DRIVER_RELPOINTER_DIRECTION defined direction

◆ DriverPrimitive() [2/5]

kodi::addon::DriverPrimitive::DriverPrimitive ( std::string keycode)
inline

Construct a driver primitive representing a key on a keyboard.

Parameters
[in]keycodeKeycode to use

◆ DriverPrimitive() [3/5]

kodi::addon::DriverPrimitive::DriverPrimitive ( unsigned int axisIndex,
int center,
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION direction,
unsigned int range )
inline

Construct a driver primitive representing the positive or negative half of an axis.

Parameters
[in]axisIndexAxis index
[in]centerCenter
[in]directionWith JOYSTICK_DRIVER_HAT_DIRECTION defined direction
[in]rangeRange

◆ DriverPrimitive() [4/5]

kodi::addon::DriverPrimitive::DriverPrimitive ( unsigned int hatIndex,
JOYSTICK_DRIVER_HAT_DIRECTION direction )
inline

Construct a driver primitive representing one of the four direction arrows on a dpad.

Parameters
[in]hatIndexHat index
[in]directionWith JOYSTICK_DRIVER_HAT_DIRECTION defined direction

◆ DriverPrimitive() [5/5]

kodi::addon::DriverPrimitive::DriverPrimitive ( void )
default

Construct an invalid driver primitive.

◆ HatDirection()

JOYSTICK_DRIVER_HAT_DIRECTION kodi::addon::DriverPrimitive::HatDirection ( void ) const
inline

Get hat direction.

Returns
The with JOYSTICK_DRIVER_HAT_DIRECTION defined direction

◆ Keycode()

const std::string & kodi::addon::DriverPrimitive::Keycode ( void ) const
inline

Get key code as string.

Returns
Key code

◆ MouseIndex()

JOYSTICK_DRIVER_MOUSE_INDEX kodi::addon::DriverPrimitive::MouseIndex ( void ) const
inline

Get mouse index.

Returns
With JOYSTICK_DRIVER_MOUSE_INDEX defined mouse index

◆ operator==()

bool kodi::addon::DriverPrimitive::operator== ( const DriverPrimitive & other) const
inline

Compare this with another class of this type.

Parameters
[in]otherOther class to compare
Returns
True if they are equal, false otherwise

◆ Range()

unsigned int kodi::addon::DriverPrimitive::Range ( void ) const
inline

Get range.

Returns
Range

◆ RelPointerDirection()

JOYSTICK_DRIVER_RELPOINTER_DIRECTION kodi::addon::DriverPrimitive::RelPointerDirection ( void ) const
inline

Get relative pointer direction.

Returns
With JOYSTICK_DRIVER_RELPOINTER_DIRECTION defined direction

◆ SemiAxisDirection()

JOYSTICK_DRIVER_SEMIAXIS_DIRECTION kodi::addon::DriverPrimitive::SemiAxisDirection ( void ) const
inline

Get semi axis direction.

Returns
With JOYSTICK_DRIVER_SEMIAXIS_DIRECTION defined direction

◆ Type()

JOYSTICK_DRIVER_PRIMITIVE_TYPE kodi::addon::DriverPrimitive::Type ( void ) const
inline

Get type of primitive.

Returns
The with JOYSTICK_DRIVER_PRIMITIVE_TYPE defined type