xbmc
Public Member Functions | List of all members
KODI::GAME::CGameClientKeyboard Class Reference

Handles keyboard events for games. More...

#include <GameClientKeyboard.h>

Inheritance diagram for KODI::GAME::CGameClientKeyboard:
Inheritance graph
[legend]
Collaboration diagram for KODI::GAME::CGameClientKeyboard:
Collaboration graph
[legend]

Public Member Functions

 CGameClientKeyboard (CGameClient &gameClient, std::string controllerId, KEYBOARD::IKeyboardInputProvider *inputProvider)
 Constructor registers for keyboard events at CInputManager. More...
 
 ~CGameClientKeyboard () override
 Destructor unregisters from keyboard events from CInputManager.
 
std::string ControllerID () const override
 The add-on ID of the keyboard's controller profile. More...
 
bool HasKey (const KEYBOARD::KeyName &key) const override
 Return true if the input handler accepts the given key. More...
 
bool OnKeyPress (const KEYBOARD::KeyName &key, KEYBOARD::Modifier mod, uint32_t unicode) override
 A key has been pressed. More...
 
void OnKeyRelease (const KEYBOARD::KeyName &key, KEYBOARD::Modifier mod, uint32_t unicode) override
 A key has been released. More...
 

Detailed Description

Handles keyboard events for games.

Listens to keyboard events and forwards them to the games (as game_input_event).

Constructor & Destructor Documentation

◆ CGameClientKeyboard()

CGameClientKeyboard::CGameClientKeyboard ( CGameClient gameClient,
std::string  controllerId,
KEYBOARD::IKeyboardInputProvider inputProvider 
)

Constructor registers for keyboard events at CInputManager.

Parameters
gameClientThe game client implementation.
controllerIdThe controller profile used for input
dllStructThe emulator or game to which the events are sent.
inputProviderThe interface providing us with keyboard input.

Member Function Documentation

◆ ControllerID()

std::string CGameClientKeyboard::ControllerID ( ) const
overridevirtual

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

Returns
The ID of the controller profile add-on

Implements KODI::KEYBOARD::IKeyboardInputHandler.

◆ HasKey()

bool CGameClientKeyboard::HasKey ( const KEYBOARD::KeyName &  key) const
overridevirtual

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

Implements KODI::KEYBOARD::IKeyboardInputHandler.

◆ OnKeyPress()

bool CGameClientKeyboard::OnKeyPress ( const KEYBOARD::KeyName &  key,
KEYBOARD::Modifier  mod,
uint32_t  unicode 
)
overridevirtual

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

Implements KODI::KEYBOARD::IKeyboardInputHandler.

◆ OnKeyRelease()

void CGameClientKeyboard::OnKeyRelease ( const KEYBOARD::KeyName &  key,
KEYBOARD::Modifier  mod,
uint32_t  unicode 
)
overridevirtual

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

Implements KODI::KEYBOARD::IKeyboardInputHandler.


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