-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 SDL Pinch events #9445
base: main
Are you sure you want to change the base?
Add SDL Pinch events #9445
Conversation
Don't worry about this; 'unstable' is a legacy categorization at this point, as they realized that requiring backwards-incompatible changes to promote protocols to stable was a bad idea. Unstable protocols will basically be unstable forever at this point. |
Original ticket was #7706 I've added some code for Macosx, but this is incomplete and untested (I have no trackpad on mac mini, and cannot get the ipad to work as a trackpad). For MACOSX, it seems:
|
Android has begin/update/end callbacks for pinch events. |
On IOS, added callbacks to handle pinch gestures. maybe, we shouldn't try to expose the swipe gesture, because, it's seems to be very different across platforms, 1 or several fingers (even the ability to report the number of fingers) and also behavior (scroll vs swipe -finger goes up at the end-) |
e4ce5cf
to
262b012
Compare
1c82253
to
2081211
Compare
9f9ac41
to
d9e4658
Compare
backend: x11/wayland/macosx/ios/Android
d9e4658
to
023cf24
Compare
@libsdl-org/a-team hey, It compiles and has been cleaned up ! needs some feedback ! |
Merge This Please! |
@1bsyl, sorry I missed that you needed feedback on this. Let me review and get back to you. |
I think this is good to go as-is, it looks like your questions are about swipe gestures? I think enabling gesture support on macOS and iOS delays touch event delivery. @icculus, what do you think about implementing pinch/zoom/rotate/swipe on top of touch events to have consistent cross-platform behavior? We could include the number of fingers in the swipe across all platforms, etc.? |
Making our own pinch gestures is only going to make iOS users say "this doesn't feel right for some reason." I'd say either the OS provides them or the app doesn't get those events. |
Would it make sense to have them opt-in with some documentation about the consequences of doing so? |
@slouken no problem for the delay. actually, the PR is just a prototype to see where it goes. yes, swipe gesture are going to be really different across platform if there are implement with different os back-end (number of finger/speed are not always provided i guess). also swipe gesture is different of scroll gesture (one expect the fingers up at the border of the screen). but here, it's only about pinch. to simplify. but probably all back-end wont provide the number of finger for pinch, the rotation angle, the center, speed. It makes sense that this introduce a delay for touch event. Probably that internally it starts to buffer touch event, and try to detect gestures: when the gesture is detected and sent, the touch event are discarded. A question here is: should we send the touch event if a gesture is detected ? I personally won´t really use the gesture things, but that sounds much easier to implement on top of touch event, than per back-end. I don't see how different ios people are used to pinch/scroll/etc that others, but maybe we could add some customization: like setting how many event before detecting a pinch/ how many finger for a scroll on ios, etc. I mean some customization so that the generic layer feels like it was a real platform back-end. |
Some update:
Added SDL Pinch event (begin/update/end), with the delta scale factor.
We could add more data then the scale factor value if needed afterward (position center, diameter, rotation, global scale factor, velocity), but not sure all back-end can provide it.
I've removed the Swipe event, because it seems to be really different across platform (number fingers, swipe vs scroll definition).
Currently implemented:
--info event_motion
in command line for verbosity)Todo:
keeping the old message, because it has some info: