Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <KeymapHandler.h>
Public Member Functions | |
CKeymapHandler (ACTION::IActionListener *actionHandler, const IKeymap *keymap) | |
~CKeymapHandler () override=default | |
bool | HotkeysPressed (const std::set< std::string > &keyNames) const override |
Get the pressed state of the given keys. | |
std::string | GetLastPressed () const override |
Get the key name of the last button pressed. | |
void | OnPress (const std::string &keyName) override |
Called when a key has emitted an action after bring pressed. | |
std::string | ControllerID () const override |
The add-on ID of the game controller associated with this input handler. | |
bool | HasFeature (const JOYSTICK::FeatureName &feature) const override |
Return true if the input handler accepts the given feature. | |
bool | AcceptsInput (const JOYSTICK::FeatureName &feature) const override |
Return true if the input handler is currently accepting input for the given feature. | |
bool | OnButtonPress (const JOYSTICK::FeatureName &feature, bool bPressed) override |
A digital button has been pressed or released. | |
void | OnButtonHold (const JOYSTICK::FeatureName &feature, unsigned int holdTimeMs) override |
A digital button has been pressed for more than one event frame. | |
bool | OnButtonMotion (const JOYSTICK::FeatureName &feature, float magnitude, unsigned int motionTimeMs) override |
An analog button (trigger or a pressure-sensitive button) has changed state. | |
bool | OnAnalogStickMotion (const JOYSTICK::FeatureName &feature, float x, float y, unsigned int motionTimeMs) override |
An analog stick has moved. | |
bool | OnAccelerometerMotion (const JOYSTICK::FeatureName &feature, float x, float y, float z) override |
An accelerometer's state has changed. | |
bool | OnWheelMotion (const JOYSTICK::FeatureName &feature, float position, unsigned int motionTimeMs) override |
A wheel has changed state. | |
bool | OnThrottleMotion (const JOYSTICK::FeatureName &feature, float position, unsigned int motionTimeMs) override |
A throttle has changed state. | |
void | OnInputFrame () override |
Called at the end of the frame that provided input. | |
Public Member Functions inherited from KODI::KEYMAP::IKeymapHandler | |
virtual | ~IKeymapHandler ()=default |
Public Member Functions inherited from KODI::JOYSTICK::IInputHandler | |
virtual | ~IInputHandler ()=default |
void | SetInputReceiver (IInputReceiver *receiver) |
void | ResetInputReceiver (void) |
IInputReceiver * | InputReceiver (void) |
Protected Attributes | |
std::unique_ptr< JOYSTICK::IButtonSequence > | m_easterEgg |
CKeymapHandler::CKeymapHandler | ( | ACTION::IActionListener * | actionHandler, |
const IKeymap * | keymap ) |
|
overridedefault |
|
overridevirtual |
Return true if the input handler is currently accepting input for the given feature.
feature | A feature belonging to the controller specified by ControllerID() |
This does not prevent the input events from being called, but can return false to indicate that input wasn't handled for the specified feature.
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
The add-on ID of the game controller associated with this input handler.
Implements KODI::JOYSTICK::IInputHandler.
|
inlineoverridevirtual |
Get the key name of the last button pressed.
Implements KODI::KEYMAP::IKeymapHandler.
|
inlineoverridevirtual |
Return true if the input handler accepts the given feature.
feature | A feature belonging to the controller specified by ControllerID() |
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
Get the pressed state of the given keys.
keyNames | The key names |
Implements KODI::KEYMAP::IKeymapHandler.
|
overridevirtual |
An accelerometer's state has changed.
feature | The accelerometer being accelerated |
x | The x coordinate in the closed interval [-1, 1] |
y | The y coordinate in the closed interval [-1, 1] |
z | The z coordinate in the closed interval [-1, 1] |
Reimplemented from KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
An analog stick has moved.
feature | The analog stick being moved |
x | The x coordinate in the closed interval [-1, 1] |
y | The y coordinate in the closed interval [-1, 1] |
motionTimeMs | The time elapsed since this analog stick was centered, or 0 if the analog stick is centered |
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
A digital button has been pressed for more than one event frame.
feature | The feature being held |
holdTimeMs | The time elapsed since the initial press (ms) |
If OnButtonPress() returns true for the initial press, then this callback is invoked on subsequent frames until the button is released.
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
An analog button (trigger or a pressure-sensitive button) has changed state.
feature | The feature changing state |
magnitude | The button pressure or trigger travel distance in the closed interval [0, 1] |
motionTimeMs | The time elapsed since the magnitude was 0 |
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
A digital button has been pressed or released.
feature | The feature being pressed |
bPressed | True if pressed, false if released |
Implements KODI::JOYSTICK::IInputHandler.
|
inlineoverridevirtual |
Called at the end of the frame that provided input.
Implements KODI::JOYSTICK::IInputHandler.
|
inlineoverridevirtual |
Called when a key has emitted an action after bring pressed.
keyName | the key name that emitted the action |
Implements KODI::KEYMAP::IKeymapHandler.
|
overridevirtual |
A throttle has changed state.
Up is positive position, down is negative position.
feature | The wheel changing state |
position | The position in the closed interval [-1, 1] |
motionTimeMs | The time elapsed since the position was 0 |
Implements KODI::JOYSTICK::IInputHandler.
|
overridevirtual |
A wheel has changed state.
Left is negative position, right is positive position
feature | The wheel changing state |
position | The position in the closed interval [-1, 1] |
motionTimeMs | The time elapsed since the position was 0 |
Implements KODI::JOYSTICK::IInputHandler.
|
protected |