Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
No Matches
PERIPHERALS::CPeripheralKeyboard Class Reference

#include <PeripheralKeyboard.h>

Inheritance diagram for PERIPHERALS::CPeripheralKeyboard:
PERIPHERALS::CPeripheral KODI::KEYBOARD::IKeyboardDriverHandler KODI::JOYSTICK::IInputProvider KODI::KEYBOARD::IKeyboardInputProvider KODI::MOUSE::IMouseInputProvider

Public Member Functions

 CPeripheralKeyboard (CPeripherals &manager, const PeripheralScanResult &scanResult, CPeripheralBus *bus)
 ~CPeripheralKeyboard (void) override
bool InitialiseFeature (const PeripheralFeature feature) override
 Initialise one of the features of this peripheral.
void RegisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler, bool bPromiscuous) override
void UnregisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler) override
CDateTime LastActive () const override
 Return the last time this peripheral was active.
KODI::GAME::ControllerPtr ControllerProfile () const override
 Get the controller profile that best represents this peripheral.
bool OnKeyPress (const CKey &key) override
 A key has been pressed.
void OnKeyRelease (const CKey &key) override
 A key has been released.
- Public Member Functions inherited from PERIPHERALS::CPeripheral
 CPeripheral (CPeripherals &manager, const PeripheralScanResult &scanResult, CPeripheralBus *bus)
 ~CPeripheral (void) override
bool operator== (const CPeripheral &right) const
bool operator!= (const CPeripheral &right) const
bool operator== (const PeripheralScanResult &right) const
bool operator!= (const PeripheralScanResult &right) const
const std::string & FileLocation (void) const
const std::string & Location (void) const
int VendorId (void) const
const char * VendorIdAsString (void) const
int ProductId (void) const
const char * ProductIdAsString (void) const
PeripheralType Type (void) const
PeripheralBusType GetBusType (void) const
const std::string & DeviceName (void) const
bool IsHidden (void) const
void SetHidden (bool bSetTo=true)
const std::string & GetVersionInfo (void) const
virtual std::string GetIcon () const
 Get an icon for this peripheral.
bool HasFeature (const PeripheralFeature feature) const
 Check whether this device has the given feature.
void GetFeatures (std::vector< PeripheralFeature > &features) const
 Get all features that are supported by this device.
bool Initialise (void)
 Initialises the peripheral.
virtual void OnUserNotification ()
 Briefly activate a feature to notify the user.
virtual bool TestFeature (PeripheralFeature feature)
 Briefly test one of the features of this peripheral.
virtual void OnSettingChanged (const std::string &strChangedSetting)
 Called when a setting changed.
virtual void OnDeviceRemoved (void)
 Called when this device is removed, before calling the destructor.
virtual void GetSubdevices (PeripheralVector &subDevices) const
 Get all subdevices if this device is multifunctional.
virtual bool IsMultiFunctional (void) const
virtual void AddSetting (const std::string &strKey, const std::shared_ptr< const CSetting > &setting, int order)
 Add a setting to this peripheral. This will overwrite a previous setting with the same key.
virtual bool HasSetting (const std::string &strKey) const
 Check whether a setting is known with the given key.
virtual bool HasSettings (void) const
virtual bool HasConfigurableSettings (void) const
virtual const std::string GetSettingString (const std::string &strKey) const
 Get the value of a setting.
virtual bool SetSetting (const std::string &strKey, const std::string &strValue)
virtual void SetSettingVisible (const std::string &strKey, bool bSetTo)
virtual bool IsSettingVisible (const std::string &strKey) const
virtual int GetSettingInt (const std::string &strKey) const
virtual bool SetSetting (const std::string &strKey, int iValue)
virtual bool GetSettingBool (const std::string &strKey) const
virtual bool SetSetting (const std::string &strKey, bool bValue)
virtual float GetSettingFloat (const std::string &strKey) const
virtual bool SetSetting (const std::string &strKey, float fValue)
virtual void PersistSettings (bool bExiting=false)
virtual void LoadPersistedSettings (void)
virtual void ResetDefaultSettings (void)
virtual std::vector< std::shared_ptr< CSetting > > GetSettings (void) const
virtual bool ErrorOccured (void) const
virtual void RegisterJoystickDriverHandler (KODI::JOYSTICK::IDriverHandler *handler, bool bPromiscuous)
virtual void UnregisterJoystickDriverHandler (KODI::JOYSTICK::IDriverHandler *handler)
virtual void RegisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler, bool bPromiscuous)
virtual void UnregisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler)
void RegisterInputHandler (KODI::JOYSTICK::IInputHandler *handler, bool bPromiscuous) override
 Register a handler for the provided input.
void UnregisterInputHandler (KODI::JOYSTICK::IInputHandler *handler) override
 Unregister a handler.
void RegisterKeyboardHandler (KODI::KEYBOARD::IKeyboardInputHandler *handler, bool bPromiscuous, bool forceDefaultMap) override
 Registers a handler to be called on keyboard input.
void UnregisterKeyboardHandler (KODI::KEYBOARD::IKeyboardInputHandler *handler) override
 Unregisters handler from keyboard input.
void RegisterMouseHandler (KODI::MOUSE::IMouseInputHandler *handler, bool bPromiscuous, bool forceDefaultMap) override
 Registers a handler to be called on mouse input.
void UnregisterMouseHandler (KODI::MOUSE::IMouseInputHandler *handler) override
 Unregisters handler from mouse input.
virtual void RegisterJoystickButtonMapper (KODI::JOYSTICK::IButtonMapper *mapper)
virtual void UnregisterJoystickButtonMapper (KODI::JOYSTICK::IButtonMapper *mapper)
virtual KODI::JOYSTICK::IDriverReceiverGetDriverReceiver ()
virtual KODI::KEYMAP::IKeymapGetKeymap (const std::string &controllerId)
virtual void SetControllerProfile (const KODI::GAME::ControllerPtr &controller)
 Set the controller profile for this peripheral.
- Public Member Functions inherited from KODI::JOYSTICK::IInputProvider
virtual ~IInputProvider ()=default
- Public Member Functions inherited from KODI::KEYBOARD::IKeyboardInputProvider
virtual ~IKeyboardInputProvider ()=default
- Public Member Functions inherited from KODI::MOUSE::IMouseInputProvider
virtual ~IMouseInputProvider ()=default
- Public Member Functions inherited from KODI::KEYBOARD::IKeyboardDriverHandler
virtual ~IKeyboardDriverHandler ()=default

Additional Inherited Members

- Protected Member Functions inherited from PERIPHERALS::CPeripheral
virtual void ClearSettings (void)
- Protected Attributes inherited from PERIPHERALS::CPeripheral
PeripheralType m_type
PeripheralBusType m_busType
PeripheralBusType m_mappedBusType
std::string m_strLocation
std::string m_strDeviceName
std::string m_strSettingsFile
std::string m_strFileLocation
int m_iVendorId
std::string m_strVendorId
int m_iProductId
std::string m_strProductId
std::string m_strVersionInfo
bool m_bInitialised = false
bool m_bHidden = false
bool m_bError = false
std::vector< PeripheralFeaturem_features
PeripheralVector m_subDevices
std::map< std::string, PeripheralDeviceSettingm_settings
std::set< std::string > m_changedSettings
std::map< KODI::JOYSTICK::IInputHandler *, std::unique_ptr< KODI::JOYSTICK::IDriverHandler > > m_inputHandlers
std::map< KODI::KEYBOARD::IKeyboardInputHandler *, std::unique_ptr< KODI::KEYBOARD::IKeyboardDriverHandler > > m_keyboardHandlers
std::map< KODI::MOUSE::IMouseInputHandler *, std::unique_ptr< KODI::MOUSE::IMouseDriverHandler > > m_mouseHandlers
std::map< KODI::JOYSTICK::IButtonMapper *, std::unique_ptr< CAddonButtonMapping > > m_buttonMappers
KODI::GAME::ControllerPtr m_controllerProfile

Constructor & Destructor Documentation

◆ CPeripheralKeyboard()

CPeripheralKeyboard::CPeripheralKeyboard ( CPeripherals & manager,
const PeripheralScanResult & scanResult,
CPeripheralBus * bus )

◆ ~CPeripheralKeyboard()

CPeripheralKeyboard::~CPeripheralKeyboard ( void )

Member Function Documentation

◆ ControllerProfile()

GAME::ControllerPtr CPeripheralKeyboard::ControllerProfile ( ) const

Get the controller profile that best represents this peripheral.

The controller profile, or empty if unknown

Reimplemented from PERIPHERALS::CPeripheral.

◆ InitialiseFeature()

bool CPeripheralKeyboard::InitialiseFeature ( const PeripheralFeature feature)

Initialise one of the features of this peripheral.

featureThe feature to initialise.
True when the feature has been initialised successfully, false otherwise.

Reimplemented from PERIPHERALS::CPeripheral.

◆ LastActive()

CDateTime PERIPHERALS::CPeripheralKeyboard::LastActive ( ) const

Return the last time this peripheral was active.

The time of last activation, or invalid if unknown/never active

Reimplemented from PERIPHERALS::CPeripheral.

◆ OnKeyPress()

bool CPeripheralKeyboard::OnKeyPress ( const CKey & key)

A key has been pressed.

keyThe pressed key
True if the event was handled, false otherwise

Implements KODI::KEYBOARD::IKeyboardDriverHandler.

◆ OnKeyRelease()

void CPeripheralKeyboard::OnKeyRelease ( const CKey & key)

A key has been released.

keyThe released key

Implements KODI::KEYBOARD::IKeyboardDriverHandler.

◆ RegisterKeyboardDriverHandler()

void CPeripheralKeyboard::RegisterKeyboardDriverHandler ( KODI::KEYBOARD::IKeyboardDriverHandler * handler,
bool bPromiscuous )

Reimplemented from PERIPHERALS::CPeripheral.

◆ UnregisterKeyboardDriverHandler()

void CPeripheralKeyboard::UnregisterKeyboardDriverHandler ( KODI::KEYBOARD::IKeyboardDriverHandler * handler)

Reimplemented from PERIPHERALS::CPeripheral.

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