#include <AddonInputHandling.h>
|
| CAddonInputHandling (CPeripherals &manager, CPeripheral *peripheral, std::shared_ptr< CPeripheralAddon > addon, KODI::JOYSTICK::IInputHandler *handler, KODI::JOYSTICK::IDriverReceiver *receiver) |
|
| CAddonInputHandling (CPeripherals &manager, CPeripheral *peripheral, std::shared_ptr< CPeripheralAddon > addon, KODI::KEYBOARD::IKeyboardInputHandler *handler) |
|
| CAddonInputHandling (CPeripherals &manager, CPeripheral *peripheral, std::shared_ptr< CPeripheralAddon > addon, KODI::MOUSE::IMouseInputHandler *handler) |
|
| ~CAddonInputHandling (void) override |
|
bool | Load () |
|
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.
|
|
bool | SetRumbleState (const KODI::JOYSTICK::FeatureName &feature, float magnitude) override |
| Set the value of a rumble motor.
|
|
Public Member Functions inherited from KODI::JOYSTICK::IDriverHandler |
virtual | ~IDriverHandler ()=default |
|
virtual | ~IInputReceiver ()=default |
|
Public Member Functions inherited from KODI::KEYBOARD::IKeyboardDriverHandler |
virtual | ~IKeyboardDriverHandler ()=default |
|
Public Member Functions inherited from KODI::MOUSE::IMouseDriverHandler |
virtual | ~IMouseDriverHandler (void)=default |
|
◆ CAddonInputHandling() [1/3]
◆ CAddonInputHandling() [2/3]
◆ CAddonInputHandling() [3/3]
◆ ~CAddonInputHandling()
CAddonInputHandling::~CAddonInputHandling |
( |
void | | ) |
|
|
override |
◆ Load()
bool CAddonInputHandling::Load |
( |
| ) |
|
◆ OnAxisMotion()
bool CAddonInputHandling::OnAxisMotion |
( |
unsigned int | axisIndex, |
|
|
float | position, |
|
|
int | center, |
|
|
unsigned int | range ) |
|
overridevirtual |
Handle axis motion.
If a joystick feature requires multiple axes (analog sticks, accelerometers), they can be buffered for later processing.
- Parameters
-
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) |
- Returns
- True if the motion was handled, false otherwise
Implements KODI::JOYSTICK::IDriverHandler.
◆ OnButtonMotion()
bool CAddonInputHandling::OnButtonMotion |
( |
unsigned int | buttonIndex, |
|
|
bool | bPressed ) |
|
overridevirtual |
Handle button motion.
- Parameters
-
buttonIndex | The index of the button as reported by the driver |
bPressed | true for press motion, false for release motion |
- Returns
- True if a press was handled, false otherwise
Implements KODI::JOYSTICK::IDriverHandler.
◆ OnButtonPress()
A mouse button has been pressed.
- Parameters
-
button | The index of the pressed button |
- Returns
- True if the event was handled, otherwise false
Implements KODI::MOUSE::IMouseDriverHandler.
◆ OnButtonRelease()
◆ OnHatMotion()
Handle hat motion.
- Parameters
-
hatIndex | The index of the hat as reported by the driver |
state | The direction the hat is now being pressed |
- Returns
- True if the new direction was handled, false otherwise
Implements KODI::JOYSTICK::IDriverHandler.
◆ OnInputFrame()
void CAddonInputHandling::OnInputFrame |
( |
void | | ) |
|
|
overridevirtual |
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:
- Combining multiple axes into a single analog stick or accelerometer event
- Imitating an analog feature with a digital button so that events can be dispatched every frame.
Implements KODI::JOYSTICK::IDriverHandler.
◆ OnKeyPress()
bool CAddonInputHandling::OnKeyPress |
( |
const CKey & | key | ) |
|
|
overridevirtual |
◆ OnKeyRelease()
void CAddonInputHandling::OnKeyRelease |
( |
const CKey & | key | ) |
|
|
overridevirtual |
◆ OnPosition()
bool CAddonInputHandling::OnPosition |
( |
int | x, |
|
|
int | y ) |
|
overridevirtual |
Handle mouse position updates.
- Parameters
-
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.
- Returns
- True if the event was handled, false otherwise
Implements KODI::MOUSE::IMouseDriverHandler.
◆ SetRumbleState()
Set the value of a rumble motor.
- Parameters
-
feature | The name of the motor to rumble |
magnitude | The motor's new magnitude of vibration in the closed interval [0, 1] |
- Returns
- True if the event was handled otherwise false
Implements KODI::JOYSTICK::IInputReceiver.
The documentation for this class was generated from the following files: