Skip to content

Add support for mouse magnification events on MacOS.#829

Open
castano wants to merge 1 commit into
floooh:masterfrom
castano:ic-trackpad
Open

Add support for mouse magnification events on MacOS.#829
castano wants to merge 1 commit into
floooh:masterfrom
castano:ic-trackpad

Conversation

@castano

@castano castano commented May 11, 2023

Copy link
Copy Markdown
Contributor

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

floooh commented May 11, 2023

Copy link
Copy Markdown
Owner

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

floooh commented May 11, 2023

Copy link
Copy Markdown
Owner

...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

castano commented May 24, 2023

Copy link
Copy Markdown
Contributor Author

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

cschar commented Sep 16, 2024

Copy link
Copy Markdown

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