I'm trying to get interactive gesture recognition (specifically, zooming and panning) working for my Delphi / C++Builder 10.2 Tokyo app.
What I've done so far:
GestureManager1
to my form.Touch.GestureManager
to GestureManager1
.Touch.Gestures
unchecked, because I want interactive gestures (zoom and pan), not "standard" gestures.Touch.InteractiveGestures.igZoom
is checked.OnGesture
event handler.The OnGesture
event handler is triggered as expected, but the event's EventInfo.GestureID
(which is supposed to give the type of gesture - pan, zoom, etc.) is always 0.
What am I doing wrong?
"Standard" gestures (the various lines and shapes under Touch.Gestures.Standard
and "interactive" gestures (panning, zooming, rotating) are mutually exclusive.
To process "standard" or "custom" gestures", add a TGestureManager
.
To receive "interactive" gestures, you need to remove the TGestureManager
. This Embarcadero DocWiki article, which explains how gestures work in VCL and FireMonkey, specifically says:
In order to use Interactive Gestures such as zoom and rotate in a component, you do not need to associate the component with a Gesture Manager.
This Intel article has more details on Windows' various gesture interfaces. What Delphi calls "interactive" gestures correspond to Windows' WM_GESTURE
message.