![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Main input processing class. More...
#include <InputManager.h>
Public Member Functions | |
CInputManager () | |
CInputManager (const CInputManager &)=delete | |
CInputManager const & | operator= (CInputManager const &)=delete |
~CInputManager () override | |
bool | ProcessMouse (int windowId) |
decode a mouse event and reset idle timers. | |
bool | ProcessEventServer (int windowId, float frameTime) |
decode an event from the event service, this can be mouse, key, joystick, reset idle timers. | |
bool | ProcessPeripherals (float frameTime) |
decode an event from peripherals. | |
bool | Process (int windowId, float frameTime) |
Process all inputs. | |
void | InitializeInputs () |
Call once during application startup to initialize peripherals that need it. | |
void | Deinitialize () |
Deinitialize input and keymaps. | |
bool | OnEvent (XBMC_Event &newEvent) |
Handle an input event. | |
void | SetMouseActive (bool active=true) |
Control if the mouse is actively used or not. | |
void | SetMouseEnabled (bool mouseEnabled=true) |
Control if we should use a mouse or not. | |
void | SetMouseState (MOUSE_STATE mouseState) |
Set the current state of the mouse such as click, drag operation. | |
bool | IsMouseActive () |
Check if the mouse is currently active. | |
MOUSE_STATE | GetMouseState () |
Get the current state of the mouse, such as click or drag operation. | |
MousePosition | GetMousePosition () |
Get the current mouse positions x and y coordinates. | |
void | SetMouseResolution (int maxX, int maxY, float speedX, float speedY) |
Set the current screen resolution and pointer speed. | |
bool | IsControllerEnabled () const |
Get the status of the controller-enable setting. | |
bool | HasBuiltin (const std::string &command) |
Returns whether or not we can handle a given built-in command. | |
int | ExecuteBuiltin (const std::string &execute, const std::vector< std::string > ¶ms) |
Parse a builtin command and execute any input action currently only LIRC commands implemented. | |
bool | LoadKeymaps () |
bool | ReloadKeymaps () |
void | ClearKeymaps () |
void | AddKeymap (const std::string &keymap) |
void | RemoveKeymap (const std::string &keymap) |
const KODI::KEYMAP::IKeymapEnvironment * | KeymapEnvironment () const |
CAction | GetAction (int window, const CKey &key, bool fallback=true) |
Obtain the action configured for a given window and key. | |
bool | TranslateCustomControllerString (int windowId, const std::string &controllerName, int buttonId, int &action, std::string &strAction) |
bool | TranslateTouchAction (int windowId, int touchAction, int touchPointers, int &action, std::string &actionString) |
std::vector< std::shared_ptr< const KODI::KEYMAP::IWindowKeymap > > | GetJoystickKeymaps () const |
void | QueueAction (const CAction &action) |
Queue an action to be processed on the next call to Process() | |
void | OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting has changed. | |
bool | OnAction (const CAction &action) override |
Handle a GUI action. | |
void | RegisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler) |
void | UnregisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler) |
virtual void | RegisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler) |
virtual void | UnregisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler) |
![]() | |
virtual | ~ISettingCallback ()=default |
virtual bool | OnSettingChanging (const std::shared_ptr< const CSetting > &setting) |
The value of the given setting is being changed. | |
virtual void | OnSettingAction (const std::shared_ptr< const CSetting > &setting) |
The given setting has been activated. | |
virtual bool | OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) |
The given setting needs to be updated. | |
virtual void | OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName) |
The given property of the given setting has changed. | |
![]() | |
virtual | ~IActionListener ()=default |
![]() | |
Observable ()=default | |
virtual | ~Observable ()=default |
Observable & | operator= (const Observable &observable) |
virtual void | RegisterObserver (Observer *obs) |
Register an observer. | |
virtual void | UnregisterObserver (Observer *obs) |
Unregister an observer. | |
virtual void | NotifyObservers (const ObservableMessage message=ObservableMessageNone) |
Send a message to all observers when m_bObservableChanged is true. | |
virtual void | SetChanged (bool bSetTo=true) |
Mark an observable changed. | |
virtual bool | IsObserving (const Observer &obs) const |
Check whether this observable is being observed by an observer. | |
Additional Inherited Members | |
![]() | |
void | SendMessage (const ObservableMessage message) |
Send a message to all observer when m_bObservableChanged is true. | |
![]() | |
std::atomic< bool > | m_bObservableChanged {false} |
std::vector< Observer * > | m_observers |
CCriticalSection | m_obsCritSection |
Main input processing class.
This class consolidates all input generated from different sources such as mouse, keyboard, joystick or touch (in OnEvent).
Keyboard input is processed by CInputManager and forwarded to registered keyboard handlers (e.g. game clients) or as actions to the UI:
Everything around mouse
Mouse input is processed by CInputManager and forwarded to registered mouse handlers (e.g. game clients) or as actions to the UI:
CInputManager::CInputManager | ( | ) |
|
delete |
|
override |
void CInputManager::AddKeymap | ( | const std::string & | keymap | ) |
void CInputManager::ClearKeymaps | ( | ) |
void CInputManager::Deinitialize | ( | ) |
Deinitialize input and keymaps.
int CInputManager::ExecuteBuiltin | ( | const std::string & | execute, |
const std::vector< std::string > & | params ) |
Parse a builtin command and execute any input action currently only LIRC commands implemented.
[in] | execute | Command to execute |
[in] | params | parameters that was passed to the command |
Obtain the action configured for a given window and key.
window | the window id |
key | the key to query the action for |
fallback | if no action is directly configured for the given window, obtain the action from fallback window, if exists or from global config as last resort |
std::vector< std::shared_ptr< const KEYMAP::IWindowKeymap > > CInputManager::GetJoystickKeymaps | ( | ) | const |
MousePosition CInputManager::GetMousePosition | ( | ) |
Get the current mouse positions x and y coordinates.
MOUSE_STATE CInputManager::GetMouseState | ( | ) |
Get the current state of the mouse, such as click or drag operation.
bool CInputManager::HasBuiltin | ( | const std::string & | command | ) |
Returns whether or not we can handle a given built-in command.
void CInputManager::InitializeInputs | ( | ) |
Call once during application startup to initialize peripherals that need it.
bool CInputManager::IsControllerEnabled | ( | ) | const |
Get the status of the controller-enable setting.
bool CInputManager::IsMouseActive | ( | ) |
Check if the mouse is currently active.
const KEYMAP::IKeymapEnvironment * CInputManager::KeymapEnvironment | ( | ) | const |
bool CInputManager::LoadKeymaps | ( | ) |
Handle a GUI action.
action | The GUI action |
Implements KODI::ACTION::IActionListener.
bool CInputManager::OnEvent | ( | XBMC_Event & | newEvent | ) |
Handle an input event.
newEvent | event details |
|
overridevirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
|
delete |
Process all inputs.
windowId | Currently active window |
frameTime | Time in seconds since last call |
decode an event from the event service, this can be mouse, key, joystick, reset idle timers.
windowId | Currently active window |
frameTime | Time in seconds since last call |
decode a mouse event and reset idle timers.
windowId | Currently active window |
bool CInputManager::ProcessPeripherals | ( | float | frameTime | ) |
decode an event from peripherals.
frameTime | Time in seconds since last call |
Queue an action to be processed on the next call to Process()
void CInputManager::RegisterKeyboardDriverHandler | ( | KODI::KEYBOARD::IKeyboardDriverHandler * | handler | ) |
|
virtual |
bool CInputManager::ReloadKeymaps | ( | ) |
void CInputManager::RemoveKeymap | ( | const std::string & | keymap | ) |
Control if the mouse is actively used or not.
[in] | active | sets mouse active or inactive |
Control if we should use a mouse or not.
[in] | mouseEnabled | sets mouse enabled or disabled |
Set the current screen resolution and pointer speed.
[in] | maxX | screen width |
[in] | maxY | screen height |
[in] | speedX | mouse speed in x dimension |
[in] | speedY | mouse speed in y dimension |
void CInputManager::SetMouseState | ( | MOUSE_STATE | mouseState | ) |
Set the current state of the mouse such as click, drag operation.
[in] | mouseState | which state the mouse should be set to |
bool CInputManager::TranslateCustomControllerString | ( | int | windowId, |
const std::string & | controllerName, | ||
int | buttonId, | ||
int & | action, | ||
std::string & | strAction ) |
bool CInputManager::TranslateTouchAction | ( | int | windowId, |
int | touchAction, | ||
int | touchPointers, | ||
int & | action, | ||
std::string & | actionString ) |
void CInputManager::UnregisterKeyboardDriverHandler | ( | KODI::KEYBOARD::IKeyboardDriverHandler * | handler | ) |
|
virtual |