~eliasnaur/gio

1

Pinch Gesture API

Details
Message ID
<CABN121jhaearoeazL5_bYkDZCr8JUEb-2XcvjTZwmDofNWL9MA@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi

What would the API for the pinch gesture look like?

From looking at the native OSX, iOS and Android APIs
I think it can be implemented in much the same way the other
pointer events are handled.

This would mean adding a pointer.Type called pointer.Pinch
and add a Scale field to pointer.Event struct to track the scale factor.

The rotate gesture can be supported the same way with a pointer.Rotate.

Maybe, the one confusing thing about this is that these are gestures,
but the gesture module seems to be higher level events based on
multiple pointer events.

Opinions welcome
Werner
Details
Message ID
<C6MO2EQLF3ZK.2W66JH86O0PAM@testmac>
In-Reply-To
<CABN121jhaearoeazL5_bYkDZCr8JUEb-2XcvjTZwmDofNWL9MA@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Sun Oct 25, 2020 at 9:11 PM CET, Werner Laurensse wrote:
> What would the API for the pinch gesture look like?
>
> >From looking at the native OSX, iOS and Android APIs
> I think it can be implemented in much the same way the other
> pointer events are handled.
>
> This would mean adding a pointer.Type called pointer.Pinch
> and add a Scale field to pointer.Event struct to track the scale factor.
>
> The rotate gesture can be supported the same way with a pointer.Rotate.
>
> Maybe, the one confusing thing about this is that these are gestures,
> but the gesture module seems to be higher level events based on
> multiple pointer events.
>

The idea is that the pointer package is for low-level hardware events,
and the gesture package is for recognizing gesture patterns in events,
such as drag, click, and more advanced gestures such as scroll.

There's both a pointer.Scroll type for hardware scroll events (mouse
wheel) and a gesture.Scroll type for recoginizing scroll gestures
(press+drag on touchscreens).

I'd expect pinch and zoom to be a gesture type that translates a press
of two fingers and subsequent dragging to pinch and scroll distances and
rotation angles.

Elias
Reply to thread Export thread (mbox)