11 #include "input/joysticks/DriverPrimitive.h" 12 #include "input/joysticks/interfaces/IButtonMapCallback.h" 13 #include "input/joysticks/interfaces/IDriverHandler.h" 14 #include "input/keyboard/interfaces/IKeyboardDriverHandler.h" 15 #include "input/mouse/MouseTypes.h" 16 #include "input/mouse/interfaces/IMouseDriverHandler.h" 74 bool OnMotion(
bool bPressed);
78 const unsigned int m_buttonIndex;
96 bool OnMotion(HAT_STATE state);
100 const unsigned int m_hatIndex;
107 unsigned int range = 1;
108 bool bLateDiscovery =
false;
118 unsigned int axisIndex,
128 bool OnMotion(
float position);
136 void ProcessMotion();
143 bool IsMapping()
const {
return m_state == AXIS_STATE::MAPPED; }
155 enum class AXIS_STATE
206 void DetectType(
float position);
209 const unsigned int m_axisIndex;
216 bool m_initialPositionKnown;
217 float m_initialPosition;
218 bool m_initialPositionChanged;
219 std::chrono::time_point<std::chrono::steady_clock>
239 bool OnMotion(
bool bPressed);
243 const XBMCKey m_keycode;
262 bool OnMotion(
bool bPressed);
266 const MOUSE::BUTTON_ID m_buttonIndex;
286 bool OnMotion(
int x,
int y);
290 static INPUT::INTERCARDINAL_DIRECTION GetPointerDirection(
int x,
int y);
292 static const unsigned int MIN_FRAME_COUNT = 10;
295 bool m_bStarted =
false;
298 unsigned int m_frameCount = 0;
329 bool OnButtonMotion(
unsigned int buttonIndex,
bool bPressed)
override;
330 bool OnHatMotion(
unsigned int hatIndex, HAT_STATE state)
override;
331 bool OnAxisMotion(
unsigned int axisIndex,
334 unsigned int range)
override;
335 void OnInputFrame()
override;
338 bool OnKeyPress(
const CKey& key)
override;
342 bool OnPosition(
int x,
int y)
override;
343 bool OnButtonPress(MOUSE::BUTTON_ID button)
override;
344 void OnButtonRelease(MOUSE::BUTTON_ID button)
override;
347 void SaveButtonMap()
override;
348 void ResetIgnoredPrimitives()
override;
349 void RevertButtonMap()
override;
365 bool IsMapping()
const;
367 void OnLateDiscovery(
unsigned int axisIndex);
383 std::map<unsigned int, CButtonDetector> m_buttons;
384 std::map<unsigned int, CHatDetector> m_hats;
385 std::map<unsigned int, CAxisDetector> m_axes;
386 std::map<XBMCKey, CKeyDetector> m_keys;
387 std::map<MOUSE::BUTTON_ID, CMouseButtonDetector> m_mouseButtons;
388 std::unique_ptr<CPointerDetector> m_pointer;
389 std::chrono::time_point<std::chrono::steady_clock> m_lastAction;
390 uint64_t m_frameCount;
Definition: ButtonMapping.h:103
Definition: deflate.c:123
bool MapPrimitive(const CDriverPrimitive &primitive)
Dispatch a mapping event.
Definition: ButtonMapping.cpp:44
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
Definition: IDriverHandler.h:21
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:22
Detects and dispatches mapping events.
Definition: ButtonMapping.h:42
Detects when a D-pad direction should be mapped.
Definition: ButtonMapping.h:84
Detects when a keyboard key should be mapped.
Definition: ButtonMapping.h:226
bool IsMapping() const
Check if the axis was mapped and is still in motion.
Definition: ButtonMapping.h:143
Controller configuration window.
Definition: AudioDecoder.h:18
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:21
Basic driver element associated with input events.
Definition: DriverPrimitive.h:69
Detects when a mouse button should be mapped.
Definition: ButtonMapping.h:272
Detects when an axis should be mapped.
Definition: ButtonMapping.h:114
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:21