![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes) More...
#include <IDriverHandler.h>
Public Member Functions | |
virtual | ~IDriverHandler ()=default |
virtual bool | OnButtonMotion (unsigned int buttonIndex, bool bPressed)=0 |
Handle button motion. | |
virtual bool | OnHatMotion (unsigned int hatIndex, HAT_STATE state)=0 |
Handle hat motion. | |
virtual bool | OnAxisMotion (unsigned int axisIndex, float position, int center, unsigned int range)=0 |
Handle axis motion. | |
virtual void | OnInputFrame (void)=0 |
Handle buffered input motion for features that require multiple axes. | |
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
|
virtualdefault |
|
pure virtual |
Handle axis motion.
If a joystick feature requires multiple axes (analog sticks, accelerometers), they can be buffered for later processing.
axisIndex | The index of the axis as reported by the driver |
position | The position of the axis in the closed interval [-1.0, 1.0] |
center | The center point of the axis (either -1, 0 or 1) |
range | The maximum distance the axis can move (either 1 or 2) |
Implemented in KODI::JOYSTICK::CButtonMapping, KODI::JOYSTICK::CInputHandling, PERIPHERALS::CAddonButtonMapping, and PERIPHERALS::CAddonInputHandling.
|
pure virtual |
Handle button motion.
buttonIndex | The index of the button as reported by the driver |
bPressed | true for press motion, false for release motion |
Implemented in KODI::JOYSTICK::CButtonMapping, KODI::JOYSTICK::CInputHandling, PERIPHERALS::CAddonButtonMapping, and PERIPHERALS::CAddonInputHandling.
|
pure virtual |
Handle hat motion.
hatIndex | The index of the hat as reported by the driver |
state | The direction the hat is now being pressed |
Implemented in KODI::JOYSTICK::CButtonMapping, KODI::JOYSTICK::CInputHandling, PERIPHERALS::CAddonButtonMapping, and PERIPHERALS::CAddonInputHandling.
Handle buffered input motion for features that require multiple axes.
OnInputFrame() is called at the end of the frame when all axis motions have been reported. This has several uses, including:
Implemented in KODI::JOYSTICK::CButtonMapping, KODI::JOYSTICK::CInputHandling, PERIPHERALS::CAddonButtonMapping, and PERIPHERALS::CAddonInputHandling.