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

Add support for mouse magnification events on MacOS. #829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

castano
Copy link
Contributor

@castano castano commented May 11, 2023

Also flag trackpad events with SAPP_MODIFIER_TRACKPAD.

The purpose of this PR is to enable applications to support more natural for trackpad interactions, allowing them to pinch to zoom and drag to translate.

I'm hoping I can add support for this on windows through the WM_GESTURE messages. Not sure if that works with trackpads or touch screens only.

Flag trackpad events with SAPP_MODIFIER_TRACKPAD.
@floooh
Copy link
Owner

floooh commented May 11, 2023

Hmm not sure about this one (to have any gesture recognition events inside sokol_app.h), since gesture recognition is vastly different between the various operating systems.

My (long term) plan was to have a separate header (like sokol_gestures.h) which implements its own gesture recognizers (taken from Android NDK example code) on top of the low level touch events.

I had something like this in Oryol for pan, pinch and 'multi-tap': https://github.com/floooh/oryol/blob/master/code/Modules/Input/private/gestureDetectors.cc

...this would first require to add touch (pad) events to the 'desktop platforms' though.

@floooh
Copy link
Owner

floooh commented May 11, 2023

...on the other hand it's a very simple change... but I'll need to think a bit longer about this PR than the other two :)

@castano
Copy link
Contributor Author

castano commented May 24, 2023

I've been playing around with the WM_GESTURE messages, but they only seem to work with touch screens and not with touchpads. Any approach that relies on touch messages will have the same issue, since as far as I know touchpads do not report touch messages. However, some windows apps in my laptop seem to be able to react to scroll and zoom touchpad events! Not sure how they do it. I've tried Spy++ but it does not seem to work on windows 11. I'll report if I can find a way to get this to work on windows like it does on macos.

@cschar
Copy link

cschar commented Sep 16, 2024

interested in this feature! especially for MacOS trackpad pinch-zoom gestures

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.

3 participants