Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::JOYSTICK::CAxisDetector Class Reference

Detects when an axis should be mapped. More...

#include <ButtonMapping.h>

Inheritance diagram for KODI::JOYSTICK::CAxisDetector:
KODI::JOYSTICK::CPrimitiveDetector

Public Member Functions

 CAxisDetector (CButtonMapping *buttonMapping, unsigned int axisIndex, const AxisConfiguration &config)
 
bool OnMotion (float position)
 Axis state has been updated.
 
void ProcessMotion ()
 Called once per frame.
 
bool IsMapping () const
 Check if the axis was mapped and is still in motion.
 
void SetEmitted (const CDriverPrimitive &activePrimitive)
 Set the state such that this axis has generated a mapping event.
 

Additional Inherited Members

- Protected Member Functions inherited from KODI::JOYSTICK::CPrimitiveDetector
 CPrimitiveDetector (CButtonMapping *buttonMapping)
 
bool MapPrimitive (const CDriverPrimitive &primitive)
 Dispatch a mapping event.
 

Detailed Description

Detects when an axis should be mapped.

Constructor & Destructor Documentation

◆ CAxisDetector()

CAxisDetector::CAxisDetector ( CButtonMapping * buttonMapping,
unsigned int axisIndex,
const AxisConfiguration & config )

Member Function Documentation

◆ IsMapping()

bool KODI::JOYSTICK::CAxisDetector::IsMapping ( ) const
inline

Check if the axis was mapped and is still in motion.

Returns
True between when the axis is mapped and when it crosses zero

◆ OnMotion()

bool CAxisDetector::OnMotion ( float position)

Axis state has been updated.

Parameters
positionThe new state
Returns
Always true - axis motion events are always absorbed while button mapping

◆ ProcessMotion()

void CAxisDetector::ProcessMotion ( )

Called once per frame.

If an axis was activated, the button mapping command will be emitted here.

◆ SetEmitted()

void CAxisDetector::SetEmitted ( const CDriverPrimitive & activePrimitive)

Set the state such that this axis has generated a mapping event.

If an axis is mapped to the Select action, it may be pressed when button mapping begins. This function is used to indicate that the axis shouldn't be mapped until after it crosses zero again.


The documentation for this class was generated from the following files: