mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-22 03:08:24 +00:00
Reviewed IsMouseButtonDown()
This commit is contained in:
@@ -2521,7 +2521,8 @@ bool IsMouseButtonDown(int button)
|
|||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
if (IsGestureDetected(GESTURE_HOLD)) down = true;
|
if (IsGestureDetected(GESTURE_HOLD)) down = true;
|
||||||
#else
|
#else
|
||||||
if (CORE.Input.Mouse.currentButtonState[button] == 1) down = true;
|
if (glfwGetMouseButton(CORE.Window.handle, button)) down = true;
|
||||||
|
//if (CORE.Input.Mouse.currentButtonState[button] == 1) down = true;
|
||||||
|
|
||||||
// Map touches to mouse buttons checking
|
// Map touches to mouse buttons checking
|
||||||
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
|
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
|
||||||
@@ -3612,6 +3613,7 @@ static void PollInputEvents(void)
|
|||||||
// Register previous mouse states
|
// Register previous mouse states
|
||||||
CORE.Input.Mouse.previousWheelMove = CORE.Input.Mouse.currentWheelMove;
|
CORE.Input.Mouse.previousWheelMove = CORE.Input.Mouse.currentWheelMove;
|
||||||
CORE.Input.Mouse.currentWheelMove = 0;
|
CORE.Input.Mouse.currentWheelMove = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) CORE.Input.Mouse.previousButtonState[i] = CORE.Input.Mouse.currentButtonState[i];
|
for (int i = 0; i < 3; i++) CORE.Input.Mouse.previousButtonState[i] = CORE.Input.Mouse.currentButtonState[i];
|
||||||
|
|
||||||
// Loop over pending messages
|
// Loop over pending messages
|
||||||
|
Reference in New Issue
Block a user