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

#include <KeyHandler.h>

Inheritance diagram for KODI::KEYMAP::CKeyHandler:
KODI::KEYMAP::IKeyHandler

Public Member Functions

 CKeyHandler (const std::string &keyName, ACTION::IActionListener *actionHandler, const IKeymap *keymap, IKeymapHandler *keymapHandler)
 
 ~CKeyHandler () override=default
 
bool IsPressed () const override
 Return true if the key is "pressed" (has a magnitude greater than 0.5)
 
bool OnDigitalMotion (bool bPressed, unsigned int holdTimeMs) override
 A key mapped to a digital feature has been pressed or released.
 
bool OnAnalogMotion (float magnitude, unsigned int motionTimeMs) override
 Callback for keys mapped to analog features.
 
- Public Member Functions inherited from KODI::KEYMAP::IKeyHandler
virtual ~IKeyHandler ()=default
 

Constructor & Destructor Documentation

◆ CKeyHandler()

CKeyHandler::CKeyHandler ( const std::string & keyName,
ACTION::IActionListener * actionHandler,
const IKeymap * keymap,
IKeymapHandler * keymapHandler )

◆ ~CKeyHandler()

KODI::KEYMAP::CKeyHandler::~CKeyHandler ( )
overridedefault

Member Function Documentation

◆ IsPressed()

bool KODI::KEYMAP::CKeyHandler::IsPressed ( ) const
inlineoverridevirtual

Return true if the key is "pressed" (has a magnitude greater than 0.5)

Returns
True if the key is "pressed", false otherwise

Implements KODI::KEYMAP::IKeyHandler.

◆ OnAnalogMotion()

bool CKeyHandler::OnAnalogMotion ( float magnitude,
unsigned int motionTimeMs )
overridevirtual

Callback for keys mapped to analog features.

Parameters
magnitudeThe amount of the analog action
motionTimeMsThe time since the magnitude was 0
Returns
True if the key is mapped to an action, false otherwise

Implements KODI::KEYMAP::IKeyHandler.

◆ OnDigitalMotion()

bool CKeyHandler::OnDigitalMotion ( bool bPressed,
unsigned int holdTimeMs )
overridevirtual

A key mapped to a digital feature has been pressed or released.

Parameters
bPressedtrue if the key's button/axis is activated, false if deactivated
holdTimeMsThe held time in ms for pressed buttons, or 0 for released
Returns
True if the key is mapped to an action, false otherwise

Implements KODI::KEYMAP::IKeyHandler.


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