mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-22 11:18:15 +00:00
Added comment on IsMouseButtonDown() issue
IsMouseButtonDown() does not process touch state down properly, state is reseted every frame...
This commit is contained in:
@@ -2522,9 +2522,16 @@ bool IsMouseButtonDown(int button)
|
|||||||
if (IsGestureDetected(GESTURE_HOLD)) down = true;
|
if (IsGestureDetected(GESTURE_HOLD)) down = true;
|
||||||
#else
|
#else
|
||||||
if (glfwGetMouseButton(CORE.Window.handle, button)) down = true;
|
if (glfwGetMouseButton(CORE.Window.handle, button)) down = true;
|
||||||
|
|
||||||
|
// WARNING: currentButtonState is filled by an event callback and
|
||||||
|
// reseted every frame (moving value to previousButtonState), consequently,
|
||||||
|
// if button is kept down, it is not properly detected using currentButtonState
|
||||||
|
// Same issue happens with touch events, they should be stycky an not reseted
|
||||||
//if (CORE.Input.Mouse.currentButtonState[button] == 1) down = true;
|
//if (CORE.Input.Mouse.currentButtonState[button] == 1) down = true;
|
||||||
|
|
||||||
// Map touches to mouse buttons checking
|
// Map touches to mouse buttons checking
|
||||||
|
// WARNING: currentTouchState is reseted every frame and only
|
||||||
|
// refilled on mouse event (not tracking stationary state properly!)
|
||||||
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
|
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user