Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
kodi::addon::DriverPrimitive Struct Reference

#include <PeripheralUtils.h>

Public Member Functions

 DriverPrimitive (void)=default
 Construct an invalid driver primitive. More...
 
 DriverPrimitive (unsigned int hatIndex, JOYSTICK_DRIVER_HAT_DIRECTION direction)
 Construct a driver primitive representing one of the four direction arrows on a dpad. More...
 
 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. More...
 
 DriverPrimitive (std::string keycode)
 Construct a driver primitive representing a key on a keyboard. More...
 
 DriverPrimitive (JOYSTICK_DRIVER_RELPOINTER_DIRECTION direction)
 Construct a driver primitive representing one of the four direction in which a relative pointer can move. More...
 
 DriverPrimitive (const JOYSTICK_DRIVER_PRIMITIVE &primitive)
 
JOYSTICK_DRIVER_PRIMITIVE_TYPE Type (void) const
 
unsigned int DriverIndex (void) const
 
JOYSTICK_DRIVER_HAT_DIRECTION HatDirection (void) const
 
int Center (void) const
 
JOYSTICK_DRIVER_SEMIAXIS_DIRECTION SemiAxisDirection (void) const
 
unsigned int Range (void) const
 
const std::string & Keycode (void) const
 
JOYSTICK_DRIVER_MOUSE_INDEX MouseIndex (void) const
 
JOYSTICK_DRIVER_RELPOINTER_DIRECTION RelPointerDirection (void) const
 
bool operator== (const DriverPrimitive &other) const
 
void ToStruct (JOYSTICK_DRIVER_PRIMITIVE &driver_primitive) const
 

Static Public Member Functions

static DriverPrimitive CreateButton (unsigned int buttonIndex)
 Construct a driver primitive representing a joystick button. More...
 
static DriverPrimitive CreateMotor (unsigned int motorIndex)
 Construct a driver primitive representing a motor. More...
 
static DriverPrimitive CreateMouseButton (JOYSTICK_DRIVER_MOUSE_INDEX buttonIndex)
 Construct a driver primitive representing a mouse button. More...
 
static void FreeStruct (JOYSTICK_DRIVER_PRIMITIVE &primitive)
 

Protected Member Functions

 DriverPrimitive (JOYSTICK_DRIVER_PRIMITIVE_TYPE type, unsigned int driverIndex)
 Construct a driver primitive of the specified type. More...
 

Detailed Description

ADDON::DriverPrimitive

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:

  • driver index

Hat direction:

  • driver index
  • hat direction

Semiaxis:

  • driver index
  • center
  • semiaxis direction
  • range

Motor:

  • driver index

Key:

  • key code

Mouse button:

  • driver index

Relative pointer direction:

  • relative pointer direction

Constructor & Destructor Documentation

◆ DriverPrimitive() [1/7]

kodi::addon::DriverPrimitive::DriverPrimitive ( JOYSTICK_DRIVER_PRIMITIVE_TYPE  type,
unsigned int  driverIndex 
)
inlineprotected

Construct a driver primitive of the specified type.

◆ DriverPrimitive() [2/7]

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

Construct an invalid driver primitive.

◆ DriverPrimitive() [3/7]

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.

◆ DriverPrimitive() [4/7]

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.

◆ DriverPrimitive() [5/7]

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

Construct a driver primitive representing a key on a keyboard.

◆ DriverPrimitive() [6/7]

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.

◆ DriverPrimitive() [7/7]

kodi::addon::DriverPrimitive::DriverPrimitive ( const JOYSTICK_DRIVER_PRIMITIVE primitive)
inlineexplicit

Member Function Documentation

◆ Center()

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

◆ CreateButton()

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

Construct a driver primitive representing a joystick button.

◆ CreateMotor()

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

Construct a 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.

◆ DriverIndex()

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

◆ FreeStruct()

static void kodi::addon::DriverPrimitive::FreeStruct ( JOYSTICK_DRIVER_PRIMITIVE primitive)
inlinestatic

◆ HatDirection()

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

◆ Keycode()

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

◆ MouseIndex()

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

◆ operator==()

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

◆ Range()

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

◆ RelPointerDirection()

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

◆ SemiAxisDirection()

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

◆ ToStruct()

void kodi::addon::DriverPrimitive::ToStruct ( JOYSTICK_DRIVER_PRIMITIVE driver_primitive) const
inline

◆ Type()

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

The documentation for this struct was generated from the following file: