Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::KEYBOARD::IKeyboardInputHandler Class Referenceabstract

Interface for handling input events for keyboards. More...

#include <IKeyboardInputHandler.h>

Inheritance diagram for KODI::KEYBOARD::IKeyboardInputHandler:
KODI::GAME::CAgentKeyboard KODI::GAME::CGameClientKeyboard

Public Member Functions

virtual ~IKeyboardInputHandler ()=default
 
virtual std::string ControllerID () const =0
 The add-on ID of the keyboard's controller profile.
 
virtual bool HasKey (const KeyName &key) const =0
 Return true if the input handler accepts the given key.
 
virtual bool OnKeyPress (const KeyName &key, Modifier mod, uint32_t unicode)=0
 A key has been pressed.
 
virtual void OnKeyRelease (const KeyName &key, Modifier mod, uint32_t unicode)=0
 A key has been released.
 

Detailed Description

Interface for handling input events for keyboards.

Input events are an abstraction over driver events. Keys are identified by the name defined in the keyboard's controller profile.

Constructor & Destructor Documentation

◆ ~IKeyboardInputHandler()

virtual KODI::KEYBOARD::IKeyboardInputHandler::~IKeyboardInputHandler ( )
virtualdefault

Member Function Documentation

◆ ControllerID()

virtual std::string KODI::KEYBOARD::IKeyboardInputHandler::ControllerID ( ) const
pure virtual

The add-on ID of the keyboard's controller profile.

Returns
The ID of the controller profile add-on

Implemented in KODI::GAME::CGameClientKeyboard, and KODI::GAME::CAgentKeyboard.

◆ HasKey()

virtual bool KODI::KEYBOARD::IKeyboardInputHandler::HasKey ( const KeyName & key) const
pure virtual

Return true if the input handler accepts the given key.

Parameters
keyA key belonging to the controller specified by ControllerID()
Returns
True if the key is used for input, false otherwise

Implemented in KODI::GAME::CGameClientKeyboard, and KODI::GAME::CAgentKeyboard.

◆ OnKeyPress()

virtual bool KODI::KEYBOARD::IKeyboardInputHandler::OnKeyPress ( const KeyName & key,
Modifier mod,
uint32_t unicode )
pure virtual

A key has been pressed.

Parameters
keyA key belonging to the controller specified by ControllerID()
modA combination of modifiers
unicodeThe unicode value associated with the key, or 0 if unknown
Returns
True if the event was handled, false otherwise

Implemented in KODI::GAME::CGameClientKeyboard, and KODI::GAME::CAgentKeyboard.

◆ OnKeyRelease()

virtual void KODI::KEYBOARD::IKeyboardInputHandler::OnKeyRelease ( const KeyName & key,
Modifier mod,
uint32_t unicode )
pure virtual

A key has been released.

Parameters
keyA key belonging to the controller specified by ControllerID()
modA combination of modifiers
unicodeThe unicode value associated with the key, or 0 if unknown

Implemented in KODI::GAME::CGameClientKeyboard, and KODI::GAME::CAgentKeyboard.


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