|
|
@ -438,12 +438,12 @@ typedef struct CoreData { |
|
|
|
bool cursorHidden; // Track if cursor is hidden |
|
|
|
bool cursorOnScreen; // Tracks if cursor is inside client area |
|
|
|
|
|
|
|
char currentButtonState[mi">3]; // Registers current mouse button state |
|
|
|
char previousButtonState[mi">3]; // Registers previous mouse button state |
|
|
|
char currentButtonState[n">MOUSE_BUTTON_MAX]; // Registers current mouse button state |
|
|
|
char previousButtonState[n">MOUSE_BUTTON_MAX]; // Registers previous mouse button state |
|
|
|
float currentWheelMove; // Registers current mouse wheel variation |
|
|
|
float previousWheelMove; // Registers previous mouse wheel variation |
|
|
|
#if defined(PLATFORM_RPI) || defined(PLATFORM_DRM) |
|
|
|
char currentButtonStateEvdev[mi">3]; // Holds the new mouse state for the next polling event to grab (Can't be written directly due to multithreading, app could miss the update) |
|
|
|
char currentButtonStateEvdev[n">MOUSE_BUTTON_MAX]; // Holds the new mouse state for the next polling event to grab (Can't be written directly due to multithreading, app could miss the update) |
|
|
|
#endif |
|
|
|
} Mouse; |
|
|
|
struct { |
|
|
@ -5351,11 +5351,11 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) |
|
|
|
|
|
|
|
if (flags == AMOTION_EVENT_ACTION_DOWN || flags == AMOTION_EVENT_ACTION_MOVE) |
|
|
|
{ |
|
|
|
CORE.Input.Touch.currentTouchState[MOUSE_LEFT_BUTTON] = 1; |
|
|
|
CORE.Input.Touch.currentTouchState[MOUSE_BUTTON_LEFT] = 1; |
|
|
|
} |
|
|
|
else if (flags == AMOTION_EVENT_ACTION_UP) |
|
|
|
{ |
|
|
|
CORE.Input.Touch.currentTouchState[MOUSE_LEFT_BUTTON] = 0; |
|
|
|
CORE.Input.Touch.currentTouchState[MOUSE_BUTTON_LEFT] = 0; |
|
|
|
} |
|
|
|
|
|
|
|
#if defined(SUPPORT_GESTURES_SYSTEM) |
|
|
@ -6068,11 +6068,11 @@ static void *EventThread(void *arg) |
|
|
|
// Touchscreen tap |
|
|
|
if (event.code == ABS_PRESSURE) |
|
|
|
{ |
|
|
|
int previousMouseLeftButtonState = CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_LEFT_BUTTON]; |
|
|
|
int previousMouseLeftButtonState = CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT]; |
|
|
|
|
|
|
|
if (!event.value && previousMouseLeftButtonState) |
|
|
|
{ |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_LEFT_BUTTON] = 0; |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 0; |
|
|
|
|
|
|
|
#if defined(SUPPORT_GESTURES_SYSTEM) |
|
|
|
touchAction = TOUCH_UP; |
|
|
@ -6082,7 +6082,7 @@ static void *EventThread(void *arg) |
|
|
|
|
|
|
|
if (event.value && !previousMouseLeftButtonState) |
|
|
|
{ |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_LEFT_BUTTON] = 1; |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 1; |
|
|
|
|
|
|
|
#if defined(SUPPORT_GESTURES_SYSTEM) |
|
|
|
touchAction = TOUCH_DOWN; |
|
|
@ -6099,7 +6099,7 @@ static void *EventThread(void *arg) |
|
|
|
// Mouse button parsing |
|
|
|
if ((event.code == BTN_TOUCH) || (event.code == BTN_LEFT)) |
|
|
|
{ |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_LEFT_BUTTON] = event.value; |
|
|
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = event.value; |
|
|
|
|
|
|
|
#if defined(SUPPORT_GESTURES_SYSTEM) |
|
|
|
if (event.value > 0) touchAction = TOUCH_DOWN; |
|
|
@ -6108,8 +6108,12 @@ static void *EventThread(void *arg) |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_RIGHT_BUTTON] = event.value; |
|
|
|
if (event.code == BTN_MIDDLE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_MIDDLE_BUTTON] = event.value; |
|
|
|
if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_RIGHT] = event.value; |
|
|
|
if (event.code == BTN_MIDDLE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_MIDDLE] = event.value; |
|
|
|
if (event.code == BTN_SIDE) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_SIDE] = event.value; |
|
|
|
if (event.code == BTN_EXTRA) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_EXTRA] = event.value; |
|
|
|
if (event.code == BTN_FORWARD) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_FORWARD] = event.value; |
|
|
|
if (event.code == BTN_BACK) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_BACK] = event.value; |
|
|
|
} |
|
|
|
|
|
|
|
// Screen confinement |
|
|
|