11 #include "input/actions/Action.h" 12 #include "input/actions/interfaces/IActionListener.h" 13 #include "input/keyboard/KeyboardStat.h" 14 #include "input/keymaps/ButtonStat.h" 15 #include "input/mouse/MouseStat.h" 16 #include "input/mouse/interfaces/IMouseInputProvider.h" 17 #include "settings/lib/ISettingCallback.h" 18 #include "threads/CriticalSection.h" 19 #include "utils/Observer.h" 20 #include "windowing/XBMC_events.h" 35 class IKeyboardDriverHandler;
40 class CButtonTranslator;
41 class CCustomControllerTranslator;
42 class CJoystickMapper;
43 class CTouchTranslator;
44 class IKeymapEnvironment;
50 class IMouseDriverHandler;
83 bool ProcessMouse(
int windowId);
92 bool ProcessEventServer(
int windowId,
float frameTime);
99 bool ProcessPeripherals(
float frameTime);
107 bool Process(
int windowId,
float frameTime);
112 void InitializeInputs();
131 void SetMouseActive(
bool active =
true);
137 void SetMouseEnabled(
bool mouseEnabled =
true);
144 void SetMouseState(MOUSE_STATE mouseState);
150 bool IsMouseActive();
157 MOUSE_STATE GetMouseState();
174 void SetMouseResolution(
int maxX,
int maxY,
float speedX,
float speedY);
179 bool IsControllerEnabled()
const;
184 bool HasBuiltin(
const std::string& command);
193 int ExecuteBuiltin(
const std::string& execute,
const std::vector<std::string>& params);
197 bool ReloadKeymaps();
199 void AddKeymap(
const std::string& keymap);
200 void RemoveKeymap(
const std::string& keymap);
213 CAction GetAction(
int window,
const CKey& key,
bool fallback =
true);
215 bool TranslateCustomControllerString(
int windowId,
216 const std::string& controllerName,
219 std::string& strAction);
221 bool TranslateTouchAction(
222 int windowId,
int touchAction,
int touchPointers,
int& action, std::string& actionString);
224 std::vector<std::shared_ptr<const KODI::KEYMAP::IWindowKeymap>> GetJoystickKeymaps()
const;
229 void QueueAction(
const CAction& action);
232 void OnSettingChanged(
const std::shared_ptr<const CSetting>& setting)
override;
235 bool OnAction(
const CAction& action)
override;
250 bool OnKey(
const CKey& key);
257 void OnKeyUp(
const CKey& key);
264 bool HandleKey(
const CKey& key);
273 bool AlwaysProcess(
const CAction& action);
282 bool ExecuteInputAction(
const CAction& action);
286 void ProcessQueuedActions();
293 std::map<std::string, std::map<int, float>> m_lastAxisMap;
295 std::vector<CAction> m_queuedActions;
296 CCriticalSection m_actionMutex;
299 std::unique_ptr<KODI::KEYMAP::IKeymapEnvironment> m_keymapEnvironment;
300 std::unique_ptr<KODI::KEYMAP::CButtonTranslator> m_buttonTranslator;
301 std::unique_ptr<KODI::KEYMAP::CCustomControllerTranslator> m_customControllerTranslator;
302 std::unique_ptr<KODI::KEYMAP::CTouchTranslator> m_touchTranslator;
303 std::unique_ptr<KODI::KEYMAP::CJoystickMapper> m_joystickTranslator;
305 std::vector<KODI::KEYBOARD::IKeyboardDriverHandler*> m_keyboardHandlers;
306 std::vector<KODI::MOUSE::IMouseDriverHandler*> m_mouseHandlers;
308 std::unique_ptr<KODI::KEYBOARD::IKeyboardDriverHandler> m_keyboardEasterEgg;
311 bool m_enableController =
true;
314 static const std::string SETTING_INPUT_ENABLE_CONTROLLER;
Definition: ISettingCallback.h:16
Definition: MouseStat.h:94
Customizes the environment in which keymapping is performed.
Definition: IKeymapEnvironment.h:27
Class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:21
Definition: AudioDecoder.h:18
Definition: KeyboardStat.h:40
Definition: ProfileManager.h:25
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:22
Definition: XBMC_events.h:117
Definition: MouseStat.h:102
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:22
Interface defining methods to handle GUI actions.
Definition: IActionListener.h:22
Definition: Observer.h:44