![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonButtonMapping.h>
Public Member Functions | |
CAddonButtonMapping (CPeripherals &manager, CPeripheral *peripheral, KODI::JOYSTICK::IButtonMapper *mapper) | |
~CAddonButtonMapping (void) override | |
bool | OnButtonMotion (unsigned int buttonIndex, bool bPressed) override |
Handle button motion. | |
bool | OnHatMotion (unsigned int hatIndex, KODI::JOYSTICK::HAT_STATE state) override |
Handle hat motion. | |
bool | OnAxisMotion (unsigned int axisIndex, float position, int center, unsigned int range) override |
Handle axis motion. | |
void | OnInputFrame (void) override |
Handle buffered input motion for features that require multiple axes. | |
bool | OnKeyPress (const CKey &key) override |
A key has been pressed. | |
void | OnKeyRelease (const CKey &key) override |
A key has been released. | |
bool | OnPosition (int x, int y) override |
Handle mouse position updates. | |
bool | OnButtonPress (KODI::MOUSE::BUTTON_ID button) override |
A mouse button has been pressed. | |
void | OnButtonRelease (KODI::MOUSE::BUTTON_ID button) override |
A mouse button has been released. | |
void | SaveButtonMap () override |
Save the button map. | |
void | ResetIgnoredPrimitives () override |
Clear the list of ignored driver primitives. | |
void | RevertButtonMap () override |
Revert changes to the button map since the last time it was loaded or committed to disk. | |
![]() | |
virtual | ~IDriverHandler ()=default |
![]() | |
virtual | ~IKeyboardDriverHandler ()=default |
![]() | |
virtual | ~IMouseDriverHandler (void)=default |
![]() | |
virtual | ~IButtonMapCallback ()=default |
CAddonButtonMapping::CAddonButtonMapping | ( | CPeripherals & | manager, |
CPeripheral * | peripheral, | ||
KODI::JOYSTICK::IButtonMapper * | mapper ) |
|
override |
|
overridevirtual |
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) |
Implements KODI::JOYSTICK::IDriverHandler.
|
overridevirtual |
Handle button motion.
buttonIndex | The index of the button as reported by the driver |
bPressed | true for press motion, false for release motion |
Implements KODI::JOYSTICK::IDriverHandler.
|
overridevirtual |
A mouse button has been pressed.
button | The index of the pressed button |
Implements KODI::MOUSE::IMouseDriverHandler.
|
overridevirtual |
A mouse button has been released.
button | The index of the released button |
Implements KODI::MOUSE::IMouseDriverHandler.
|
overridevirtual |
Handle hat motion.
hatIndex | The index of the hat as reported by the driver |
state | The direction the hat is now being pressed |
Implements KODI::JOYSTICK::IDriverHandler.
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:
Implements KODI::JOYSTICK::IDriverHandler.
A key has been pressed.
key | The pressed key |
Implements KODI::KEYBOARD::IKeyboardDriverHandler.
A key has been released.
key | The released key |
Implements KODI::KEYBOARD::IKeyboardDriverHandler.
Handle mouse position updates.
x | The new x coordinate of the pointer |
y | The new y coordinate of the pointer |
The mouse uses a left-handed (graphics) cartesian coordinate system. Positive X is right, positive Y is down.
Implements KODI::MOUSE::IMouseDriverHandler.
|
overridevirtual |
Clear the list of ignored driver primitives.
Called if the user begins capturing primitives to be ignored, and no primitives are captured before the dialog is accepted by the user.
In this case, the button mapper won't have been given access to the button map, so a callback is needed to indicate that no primitives were captured and the user accepted this.
Implements KODI::JOYSTICK::IButtonMapCallback.
|
overridevirtual |
Revert changes to the button map since the last time it was loaded or committed to disk.
Implements KODI::JOYSTICK::IButtonMapCallback.
|
overridevirtual |
Save the button map.
Implements KODI::JOYSTICK::IButtonMapCallback.