Skip to content

Support for pinch events #515

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Support for pinch events #515

wants to merge 1 commit into from

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Jun 5, 2024

Experimental PR to look into pinch events. See pygfx/rendercanvas#31

Status

Seems it can be made to work for Qt. Likely also for jupyter. Not (for now) on glfw. Also quite some work to do in pygfx. Looked into it, and made this PR to save what I found.

Tasks

  • Implement for Qt.
  • Implement for wx?
  • Implement for glfw. Looks like we can't. Need a way to do pinch-to-zoom glfw/glfw#90
    • This is sad, because it makes code that uses pinch less portable.
  • Implement for jupyter_rfb.
  • Add modifiers and buttons to the event?
  • Add x and y to the event so it can be scoped to a viewport in pygfx?
  • In pygfx add support for pinch events.
  • Support pinch events in pygfx controllers.

@Korijn
Copy link
Collaborator

Korijn commented Jun 5, 2024

In my experience, at least on the web, instead of working with these high level gesture events and abstractions, you just work with pointer events and use the pointer IDs to discern the fingers.

@almarklein
Copy link
Member Author

Yes, that moves some of the complexity to the application level, but it is more flexible. So an alternative approach would be to make Qt work for multi-touch events. The event spec already supports multi-touch events btw.

@hmaarrfk
Copy link
Contributor

1 year later we are somewhat back to this point as we add a few more complex interactions to our applications.

In the standard workflow, one uses the left mouse button (button 1) to click and pan.

However, as soon as you change what that mouse botton does, the only way you have to pan is to "scroll out and in", So we enabled middle click and drag, however, everybody knows that the interaction is awkward.

two finger gestures, would be much better since you can both have panning, and zooming.

just a little bump 1 year later.

@Korijn
Copy link
Collaborator

Korijn commented May 31, 2025

Correct me if I'm wrong: we already support events from multiple pointers (fingers), you just have to put the state management together yourself to implement higher level gestures like pinching to zoom. Events include a pointer id.

This PR is just about adding support for built in higher level gestures from GUI frameworks.

Right?

It's not very hard to do. If you want to have it. You don't have to wait for this PR.

@hmaarrfk
Copy link
Contributor

You may be right. I’ll boot up on windows to check

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