-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Native pan and zoom for macOS + InputEventGesture #12573
Conversation
Just realized that this will break scrolling for regular panes; back to the drawing board, I guess :-/ |
b1ea17b
to
2d0fc12
Compare
Ok, the idea here is to add touchpad support for the 2d and 3d canvas without breaking scrolling behavior for the rest of Godot. This is what it looks like (all navigation done on the touchpad using "pan" and "pinch and zoom" without any additional mouse or keys): https://www.dropbox.com/s/x5zqyyknt53ykxe/touchpad-demo-20171103.mp4?dl=0 |
2d0fc12
to
ad45dca
Compare
Added support for |
ad45dca
to
0b56355
Compare
Needs a rebase now; otherwise looks fine to me (and InputEventGesture is already mentioned in another issue as necessary), but I'd like @reduz to have a look. |
0b56355
to
0bbd20e
Compare
@akien-mga @reduz rebased |
Quoting @reduz:
So good to merge, I'll just ask for a last rebase :) |
BTW, it fixes #1319 for the base API and macOS. I'll open other issues for the Linux and Windows support once this is merged. |
0bbd20e
to
5a1c9e0
Compare
5a1c9e0
to
80ad8af
Compare
A bit of an experiment actually; adds native pan and "pinch and zoom" gesture support for the 2d canvas on macOS; no other OS support yet. This is geared towards the native events the OS delivers, which in my experience always gives better results than trying to implement this from the touch points.
The PR changes the current touchpad behavior on macOS; with top of tree, using a two-finger scroll gesture actually triggers a scroll-wheel event and thus behaves like zooming by default; this is not very macOS-y. With this PR, the two-finger scroll on touchpads is now always understood to be a pan as in other macOS native apps (though
editors/2d/pan_speed
is honored and I suggest setting it to 100 - not part of this PR). A mouse scroll-wheel on the other hand still behaves as it does without this PR.The big change that probably needs discussion here is adding
InputEventGesture
and how to pass around these kind of gesture events. Just for the record, QT has something similar: http://doc.qt.io/qt-5/qnativegestureevent.html. I believe it is something different than a touch event.Bugsquad edit: Fixes #1319.