beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.32k stars 670 forks source link

Detecting multi-touch gestures on mobile #2012

Open nhansendev opened 1 year ago

nhansendev commented 1 year ago

What is the problem or limitation you are having?

Sorry if I've missed existing documentation.

I'm trying to understand how multi-touch gestures on mobile are handled, especially when widgets don't have something built-in to handle them. For example, what if I want to zoom in on an image/canvas by using a two-finger-pinch type gesture? What if I want to rotate an image using a two-finger-twist gesture? Are the individual finger positions made available to us through toga?

Describe the solution you'd like

Documentation on how multi-touch user inputs are accessed on mobile

Describe alternatives you've considered

Maybe an external library to track gestures?

Additional context

No response

freakboy3742 commented 1 year ago

You haven't missed anything - we don't have cross-platform handlers for multi-touch interactions at this time.

You always have the option of dropping to the platform layer to access details that Toga doesn't expose publicly - however, this obviously won't be a cross platform API, and requires that you become familiar with the native APIs for whatever platform you're targeting (iOS or Android), and how to map those APIs into Python. It's certainly possible, but not trivial.