11 #include "windowing/XBMC_events.h" 13 #define XBMC_BUTTON(X) (1 << ((X)-1)) 14 #define XBMC_BUTTON_LEFT 1 15 #define XBMC_BUTTON_MIDDLE 2 16 #define XBMC_BUTTON_RIGHT 3 17 #define XBMC_BUTTON_WHEELUP 4 18 #define XBMC_BUTTON_WHEELDOWN 5 19 #define XBMC_BUTTON_X1 6 20 #define XBMC_BUTTON_X2 7 21 #define XBMC_BUTTON_X3 8 22 #define XBMC_BUTTON_X4 9 23 #define XBMC_BUTTON_LMASK XBMC_BUTTON(XBMC_BUTTON_LEFT) 24 #define XBMC_BUTTON_MMASK XBMC_BUTTON(XBMC_BUTTON_MIDDLE) 25 #define XBMC_BUTTON_RMASK XBMC_BUTTON(XBMC_BUTTON_RIGHT) 26 #define XBMC_BUTTON_X1MASK XBMC_BUTTON(XBMC_BUTTON_X1) 27 #define XBMC_BUTTON_X2MASK XBMC_BUTTON(XBMC_BUTTON_X2) 28 #define XBMC_BUTTON_X3MASK XBMC_BUTTON(XBMC_BUTTON_X3) 29 #define XBMC_BUTTON_X4MASK XBMC_BUTTON(XBMC_BUTTON_X4) 31 #define MOUSE_MINIMUM_MOVEMENT 2 32 #define MOUSE_DOUBLE_CLICK_LENGTH 500L 33 #define MOUSE_ACTIVE_LENGTH 5000L 35 #define MOUSE_MAX_BUTTON 7 40 MOUSE_STATE_NORMAL = 1,
51 MOUSE_LEFT_BUTTON = 0,
86 bool button[MOUSE_MAX_BUTTON];
107 void SetResolution(
int maxX,
int maxY,
float speedX,
float speedY);
109 bool IsEnabled()
const;
111 void SetActive(
bool active =
true);
112 void SetState(MOUSE_STATE state) { m_pointerState = state; }
113 void SetEnabled(
bool enabled =
true);
114 MOUSE_STATE GetState()
const {
return m_pointerState; }
115 uint32_t GetKey()
const;
117 HoldAction GetHold(
int ButtonID)
const;
118 inline int GetX(
void)
const {
return m_mouseState.x; }
119 inline int GetY(
void)
const {
return m_mouseState.y; }
120 inline int GetDX(
void)
const {
return m_mouseState.dx; }
121 inline int GetDY(
void)
const {
return m_mouseState.dy; }
169 BUTTON_ACTION Update(
unsigned int time,
int x,
int y,
bool down);
174 static const unsigned int click_confines = 5;
177 static const unsigned int short_click_time = 1000;
180 static const unsigned int double_click_time = 500;
182 bool InClickRange(
int x,
int y)
const;
188 STATE_IN_DOUBLE_CLICK,
189 STATE_IN_DOUBLE_IGNORE,
193 BUTTON_STATE m_state;
205 bool MovedPastThreshold()
const;
208 MOUSE_STATE m_pointerState{MOUSE_STATE_NORMAL};
211 CButtonState m_buttonState[MOUSE_MAX_BUTTON];
215 float m_speedX{0.0f};
216 float m_speedY{0.0f};
219 unsigned int m_lastActiveTime;
221 bool bClick[MOUSE_MAX_BUTTON]{};
222 bool bDoubleClick[MOUSE_MAX_BUTTON]{};
223 HoldAction m_hold[MOUSE_MAX_BUTTON]{};
224 bool bLongClick[MOUSE_MAX_BUTTON]{};
int16_t dx
Definition: MouseStat.h:80
int x
Definition: MouseStat.h:76
Definition: MouseStat.h:91
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
int16_t dy
Definition: MouseStat.h:82
int y
Definition: MouseStat.h:78
Definition: XBMC_events.h:109
bool active
Definition: MouseStat.h:88
Definition: MouseStat.h:99
Holds everything we know about the current state of the mouse.
Definition: MouseStat.h:73
int8_t dz
Definition: MouseStat.h:84