Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches

Detailed Description

Base class for joystick feature primitives

Class for joystick features. A feature can be:

  1. scalar [1]
  2. analog stick
  3. accelerometer
  4. motor
  5. relative pointer [2]
  6. absolute pointer
  7. wheel
  8. throttle
  9. keyboard key

[1] All three driver primitives (buttons, hats and axes) have a state that can be represented using a single scalar value. For this reason, features that map to a single primitive are called "scalar features".

[2] Relative pointers are similar to analog sticks, but they use relative distances instead of positions.

Function Documentation

◆ JoystickFeature() [1/2]

JoystickFeature ( const std::string & name = "",
JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN )
inline

Class constructor.

Parameters
[in]name[optional] Name of the feature
[in]type[optional] Type of the feature, JOYSTICK_FEATURE_TYPE_UNKNOWN as default

◆ JoystickFeature() [2/2]

JoystickFeature ( const JoystickFeature & other)
inline

Class copy constructor.

Parameters
[in]otherOther class to copy on construct here

◆ operator=()

JoystickFeature & operator= ( const JoystickFeature & rhs)
inline

Copy data from another JoystickFeature class to here.

Parameters
[in]otherOther class to copy here

◆ operator==()

bool operator== ( const JoystickFeature & 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

◆ Name()

const std::string & Name ( void ) const
inline

Get name of feature.

Returns
Name of feature

◆ Type()

JOYSTICK_FEATURE_TYPE Type ( void ) const
inline

Get name of feature.

Returns
Type of feature defined with JOYSTICK_FEATURE_TYPE

◆ IsValid()

bool IsValid ( ) const
inline

Check this feature is valid.

Returns
True if valid (type != JOYSTICK_FEATURE_TYPE_UNKNOWN), false otherwise

◆ SetName()

void SetName ( const std::string & name)
inline

Set name of feature.

Parameters
[in]nameName of feature

◆ SetType()

void SetType ( JOYSTICK_FEATURE_TYPE type)
inline

Set type of feature.

Parameters
[in]typeType of feature

◆ SetInvalid()

void SetInvalid ( void )
inline

Set type as invalid.

◆ Primitive()

const DriverPrimitive & Primitive ( JOYSTICK_FEATURE_PRIMITIVE which) const
inline

Get primitive of feature by wanted type.

Parameters
[in]whichType of feature, defined with JOYSTICK_FEATURE_PRIMITIVE
Returns
Primitive of asked type

◆ SetPrimitive()

void SetPrimitive ( JOYSTICK_FEATURE_PRIMITIVE which,
const DriverPrimitive & primitive )
inline

Set primitive for feature by wanted type.

Parameters
[in]whichType of feature, defined with JOYSTICK_FEATURE_PRIMITIVE
[in]primitiveThe with DriverPrimitive defined primitive to set

◆ Primitives() [1/2]

std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & Primitives ( )
inline

Get all primitives on this class.

Returns
Array list of primitives

◆ Primitives() [2/2]

const std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & Primitives ( ) const
inline

Get all primitives on this class (as constant).

Returns
Constant array list of primitives