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" 81 bool OnMotion(
bool bPressed);
85 const unsigned int m_buttonIndex;
105 bool OnMotion(HAT_STATE state);
109 const unsigned int m_hatIndex;
116 unsigned int range = 1;
117 bool bLateDiscovery =
false;
129 unsigned int axisIndex,
139 bool OnMotion(
float position);
147 void ProcessMotion();
154 bool IsMapping()
const {
return m_state == AXIS_STATE::MAPPED; }
166 enum class AXIS_STATE
217 void DetectType(
float position);
220 const unsigned int m_axisIndex;
224 AXIS_STATE m_state = AXIS_STATE::INACTIVE;
226 AXIS_TYPE m_type = AXIS_TYPE::UNKNOWN;
227 bool m_initialPositionKnown =
false;
228 float m_initialPosition = 0.0f;
229 bool m_initialPositionChanged =
231 std::chrono::time_point<std::chrono::steady_clock>
253 bool OnMotion(
bool bPressed);
257 const XBMCKey m_keycode;
278 bool OnMotion(
bool bPressed);
304 bool OnMotion(
int x,
int y);
308 static INPUT::INTERCARDINAL_DIRECTION GetPointerDirection(
int x,
int y);
310 static const unsigned int MIN_FRAME_COUNT = 10;
313 bool m_bStarted =
false;
316 unsigned int m_frameCount = 0;
348 bool OnButtonMotion(
unsigned int buttonIndex,
bool bPressed)
override;
349 bool OnHatMotion(
unsigned int hatIndex, HAT_STATE state)
override;
350 bool OnAxisMotion(
unsigned int axisIndex,
353 unsigned int range)
override;
354 void OnInputFrame()
override;
357 bool OnKeyPress(
const CKey& key)
override;
361 bool OnPosition(
int x,
int y)
override;
366 void SaveButtonMap()
override;
367 void ResetIgnoredPrimitives()
override;
368 void RevertButtonMap()
override;
384 bool IsMapping()
const;
386 void OnLateDiscovery(
unsigned int axisIndex);
402 std::map<unsigned int, CButtonDetector> m_buttons;
403 std::map<unsigned int, CHatDetector> m_hats;
404 std::map<unsigned int, CAxisDetector> m_axes;
405 std::map<XBMCKey, CKeyDetector> m_keys;
406 std::map<MOUSE::BUTTON_ID, CMouseButtonDetector> m_mouseButtons;
407 std::unique_ptr<CPointerDetector> m_pointer;
408 std::chrono::time_point<std::chrono::steady_clock> m_lastAction;
409 uint64_t m_frameCount = 0;
Definition: ButtonMapping.h:112
Definition: deflate.c:123
BUTTON_ID
Buttons on a mouse.
Definition: MouseTypes.h:26
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
Definition: IDriverHandler.h:23
Detects and dispatches mapping events.
Definition: ButtonMapping.h:47
Detects when a D-pad direction should be mapped.
Definition: ButtonMapping.h:93
Detects when a keyboard key should be mapped.
Definition: ButtonMapping.h:240
bool IsMapping() const
Check if the axis was mapped and is still in motion.
Definition: ButtonMapping.h:154
Definition: AudioDecoder.h:18
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:22
Basic driver element associated with input events.
Definition: DriverPrimitive.h:70
Detects when a mouse button should be mapped.
Definition: ButtonMapping.h:290
Detects when an axis should be mapped.
Definition: ButtonMapping.h:125
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:22
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:28