~eliasnaur/gio

1

Support Pinch

Details
Message ID
<CABN121iTZM1URHrkU2CR+L7XB9KaeLg79sj-UXY14XWaAAmXyw@mail.gmail.com>
DKIM signature
missing
Download raw message
There is another way to support the pinch gesture on trackpads without
adding any extra fields to pointer.Event by adding the key.ModCtrl to
the Modifiers field and setting Scroll X and Y to equal to
magnification.

This is also the way most browsers support this functionality in
javascript without having access to the trackpad touch events [1] [2]
and works on both OSX and Windows.

The problem with proving this functionality through a trackpad is that
it's touch events don't map directly to the screen and to calculate
the magnification there is still a need to track the position of the
fingers and the size of the trackpad [3] [4].

Then gesture.Pinch can be implemented as a higher level multi touch
event without having to stuff the pointer.Event with extra field
rarely needed.

[1] https://kenneth.io/post/detecting-multi-touch-trackpad-gestures-in-javascript
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1052253
[3] https://stackoverflow.com/questions/3573276/know-the-position-of-the-finger-in-the-trackpad-under-mac-os-x
[4] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html
Details
Message ID
<C9PCYS4RUZ4W.3EE0ZCH9OVB14@themachine>
In-Reply-To
<CABN121iTZM1URHrkU2CR+L7XB9KaeLg79sj-UXY14XWaAAmXyw@mail.gmail.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Fri Mar 5, 2021 at 06:18, Werner Laurensse wrote:
> There is another way to support the pinch gesture on trackpads without
> adding any extra fields to pointer.Event by adding the key.ModCtrl to
> the Modifiers field and setting Scroll X and Y to equal to
> magnification.
>
> This is also the way most browsers support this functionality in
> javascript without having access to the trackpad touch events [1] [2]
> and works on both OSX and Windows.
>
> The problem with proving this functionality through a trackpad is that
> it's touch events don't map directly to the screen and to calculate
> the magnification there is still a need to track the position of the
> fingers and the size of the trackpad [3] [4].
>
> Then gesture.Pinch can be implemented as a higher level multi touch
> event without having to stuff the pointer.Event with extra field
> rarely needed.
>
> [1] https://kenneth.io/post/detecting-multi-touch-trackpad-gestures-in-javascript
> [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1052253
> [3] https://stackoverflow.com/questions/3573276/know-the-position-of-the-finger-in-the-trackpad-under-mac-os-x
> [4] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html

I'm not sure what you're proposing. Perhaps I'm being too simplistic,
but it seems to me that if you can map the fingers to a pixel positions
inside Gio's widgets, you can compute the implied rotation and scale
when the fingers move. If so, why do we need to pack the pointer events
with extra fields or special scroll events?

Elias
Reply to thread Export thread (mbox)