Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[example] Core Input Gestures for Web #3172

Merged
merged 3 commits into from Jul 16, 2023
Merged

[example] Core Input Gestures for Web #3172

merged 3 commits into from Jul 16, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jul 14, 2023

Adds an example for core input gestures for Web.

Implemented the following features:

  1. Gesture log in a more "log history" style (last gesture on the botton, previous gestures stacking up) with filters to toggle repeated and/or Hold gestures;
  2. Geometric style display to track the last gesture performed (Swipe, Tap, Doubletap, Grab, Pinch and Touch count);
  3. Protractor to display the last Swipe or Pinch degree angle;
  4. Touch and Mouse Pointer points with linked Pinch gestures;
  5. Gestures color matched between all features;
  6. Screen width dynamically set for Web.

The example was optimized for Web/HTML5 on smartphones, but should run fine on other platforms. Touch specific gestures (e.g.: Pinch) still require Touch capable hardware or Touch Emulation, but the regular Mouse Pointer works for everything else. Tested native on Linux, Web/HTML5 on Linux and Web/HTML5 on Android.

@ghost
Copy link
Author

ghost commented Jul 15, 2023

Fix Doubletap for web adds a condition to MouseButtonCallback() to stop it from calling ProcessGestureEvent() when Emscripten is present (and should be handling Touch gestures).

Fixes #3174.

@ghost
Copy link
Author

ghost commented Jul 15, 2023

Changes TAP_TIMEOUT and rgGetCurrentTime to seconds does:

  1. Changes TAP_TIMEOUT to seconds;
  2. Replaces milliseconds comments to seconds;
  3. Changes rgGetCurrentTime() standalone implementations to return seconds.

Fixes #3175.

@raysan5 raysan5 merged commit b980268 into raysan5:master Jul 16, 2023
11 of 12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jul 16, 2023

@ubkp Very nice! Thanks for all the improvements! Definitely, returning seconds is more standard than ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant