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

Handles keyboard events for games. More...

#include <GameClientKeyboard.h>

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

Public Member Functions

 CGameClientKeyboard (CGameClient &gameClient, std::string controllerId, KEYBOARD::IKeyboardInputProvider *inputProvider)
 Constructor registers for keyboard events at CInputManager.
 
 ~CGameClientKeyboard () override
 Destructor unregisters from keyboard events from CInputManager.
 
std::string ControllerID () const override
 The add-on ID of the keyboard's controller profile.
 
bool HasKey (const KEYBOARD::KeyName &key) const override
 Return true if the input handler accepts the given key.
 
bool OnKeyPress (const KEYBOARD::KeyName &key, KEYBOARD::Modifier mod, uint32_t unicode) override
 A key has been pressed.
 
void OnKeyRelease (const KEYBOARD::KeyName &key, KEYBOARD::Modifier mod, uint32_t unicode) override
 A key has been released.
 
const std::string & GetControllerID () const
 
const PERIPHERALS::PeripheralPtrGetSource () const
 
float GetActivation () const
 
void SetSource (PERIPHERALS::PeripheralPtr sourcePeripheral)
 
void ClearSource ()
 
- Public Member Functions inherited from KODI::KEYBOARD::IKeyboardInputHandler
virtual ~IKeyboardInputHandler ()=default
 

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.

◆ ~CGameClientKeyboard()

CGameClientKeyboard::~CGameClientKeyboard ( )
override

Destructor unregisters from keyboard events from CInputManager.

Member Function Documentation

◆ ClearSource()

void CGameClientKeyboard::ClearSource ( )

◆ 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.

◆ GetActivation()

float CGameClientKeyboard::GetActivation ( ) const

◆ GetControllerID()

const std::string & KODI::GAME::CGameClientKeyboard::GetControllerID ( ) const
inline

◆ GetSource()

const PERIPHERALS::PeripheralPtr & KODI::GAME::CGameClientKeyboard::GetSource ( ) const
inline

◆ 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.

◆ SetSource()

void CGameClientKeyboard::SetSource ( PERIPHERALS::PeripheralPtr sourcePeripheral)

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