|
@@ -438,12 +438,12 @@ typedef struct CoreData {
|
|
bool cursorHidden; // Track if cursor is hidden
|
|
bool cursorHidden; // Track if cursor is hidden
|
|
bool cursorOnScreen; // Tracks if cursor is inside client area
|
|
bool cursorOnScreen; // Tracks if cursor is inside client area
|
|
|
|
|
|
- char currentButtonState[3]; // Registers current mouse button state
|
|
|
|
- char previousButtonState[3]; // Registers previous mouse button state
|
|
|
|
|
|
+ char currentButtonState[MOUSE_BUTTON_MAX]; // Registers current mouse button state
|
|
|
|
+ char previousButtonState[MOUSE_BUTTON_MAX]; // Registers previous mouse button state
|
|
float currentWheelMove; // Registers current mouse wheel variation
|
|
float currentWheelMove; // Registers current mouse wheel variation
|
|
float previousWheelMove; // Registers previous mouse wheel variation
|
|
float previousWheelMove; // Registers previous mouse wheel variation
|
|
#if defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
|
|
#if defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
|
|
- char currentButtonStateEvdev[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[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
|
|
#endif
|
|
} Mouse;
|
|
} Mouse;
|
|
struct {
|
|
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)
|
|
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)
|
|
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)
|
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
|
@@ -6068,11 +6068,11 @@ static void *EventThread(void *arg)
|
|
// Touchscreen tap
|
|
// Touchscreen tap
|
|
if (event.code == ABS_PRESSURE)
|
|
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)
|
|
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)
|
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
|
touchAction = TOUCH_UP;
|
|
touchAction = TOUCH_UP;
|
|
@@ -6082,7 +6082,7 @@ static void *EventThread(void *arg)
|
|
|
|
|
|
if (event.value && !previousMouseLeftButtonState)
|
|
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)
|
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
|
touchAction = TOUCH_DOWN;
|
|
touchAction = TOUCH_DOWN;
|
|
@@ -6099,7 +6099,7 @@ static void *EventThread(void *arg)
|
|
// Mouse button parsing
|
|
// Mouse button parsing
|
|
if ((event.code == BTN_TOUCH) || (event.code == BTN_LEFT))
|
|
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 defined(SUPPORT_GESTURES_SYSTEM)
|
|
if (event.value > 0) touchAction = TOUCH_DOWN;
|
|
if (event.value > 0) touchAction = TOUCH_DOWN;
|
|
@@ -6108,8 +6108,12 @@ static void *EventThread(void *arg)
|
|
#endif
|
|
#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
|
|
// Screen confinement
|