I doubt the code you picked up in various places actually works:
The documentation on TGestureInfo clearly states that
[...] Distance is only set for the zoom and two finger tap gestures (TInteractiveGesture = igZoom or igTwoFingerTap). [...]
That means that you will have to keep track of the position the finger was registered in the previous call of onGesture
. You can then do something regarding the difference of EventInfo.Location
then and EventInfo.Location
now. Of course, this is only going to work if gfBegin
is not in GestureEvent.Flags
because you won't have a valid value for a previous position but you already know that.
Additionally, you might have a look at EventInfo.InertiaVector
for "stuff continues moving for a bit when you lift your finger". But that's entirely optional.
Also, if you're handling a gesture (no matter if interactive or standard gesture), you should set Handled
to True
. This way, you don't risk another component trying to handle the gesture. But to be honest, I'm not exactly sure if this is also the case with FireMonkey. With Vcl, it is. Compare the documentation for FMX.Types.TInteractiveGestures with Vcl.Controls.TInteractiveGestureOption. Better safe than sorry.