Reviewed IsMouseButtonDown()

This commit is contained in:
Ray 2020-03-01 01:29:34 +01:00
parent 41d3c47ffe
commit 18a9982126

View File

@ -2521,7 +2521,8 @@ bool IsMouseButtonDown(int button)
#if defined(PLATFORM_ANDROID)
if (IsGestureDetected(GESTURE_HOLD)) down = true;
#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
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
@ -3612,6 +3613,7 @@ static void PollInputEvents(void)
// Register previous mouse states
CORE.Input.Mouse.previousWheelMove = CORE.Input.Mouse.currentWheelMove;
CORE.Input.Mouse.currentWheelMove = 0;
for (int i = 0; i < 3; i++) CORE.Input.Mouse.previousButtonState[i] = CORE.Input.Mouse.currentButtonState[i];
// Loop over pending messages