[example] Core Input Gestures for Web (#3172)

* [example] Core Input Gestures for Web

* Fix Doubletap for web

* Changes TAP_TIMEOUT and rgGetCurrentTime to seconds
This commit is contained in:
ubkp 2023-07-16 08:07:29 -03:00 committed by GitHub
parent 22895ba14f
commit b980268ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 360 additions and 19 deletions

View file

@ -5593,8 +5593,14 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
gestureEvent.position[0].y /= (float)GetScreenHeight();
// Gesture data is sent to gestures-system for processing
#if defined(PLATFORM_WEB)
// Prevent calling ProcessGestureEvent() when Emscripten is present and there's a touch gesture, so EmscriptenTouchCallback() can handle it itself
if (GetMouseX() != 0 || GetMouseY() != 0) ProcessGestureEvent(gestureEvent);
#else
ProcessGestureEvent(gestureEvent);
#endif
#endif
}
// GLFW3 Cursor Position Callback, runs on mouse move