Platforms to show: All Mac Windows Linux Cross-Platform

WinGestureInfoMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Windows MBS Win Plugin 16.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Stores information about a gesture.
Example
// react to zoom and rotate gestures on a Windows touch screen
// MyPointerEvents is a subclass of WinPointerEventsMBS with the Gesture event implemented.
// PointerEvents is a property of the window: PointerEvents As MyPointerEvents
PointerEvents = New MyPointerEvents(Self)

// in MyPointerEvents:
Function Gesture(info As WinGestureInfoMBS) As Boolean Handles Gesture
Select Case info.ID
Case WinGestureInfoMBS.kGestureIDZoom
System.DebugLog "Zoom, distance " + info.Arguments.ToString + " at " + info.LocationX.ToString + "/" + info.LocationY.ToString
Return True
Case WinGestureInfoMBS.kGestureIDRotate
System.DebugLog "Rotate by " + Format(info.RotateAngle, "0.0")
Return True
End Select
End Function

Parameters for touches:
If kFlagBegin flag is set, save Location so you have first point. And save argument to check later.

For Zoom, get second point from this class. Than you can calculate center point and zoom factor is OldArgumentsLower/NewArgumentsLower.

For Pan, check difference between last point and new point to know how much moved.

For Rotate, please check difference between old RotateAngle and new RotateAngle.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Flags

Constant Value Description
kFlagBegin 1 A gesture is starting.
kFlagEnd 4 A gesture has finished.
kFlagInertia 2 A gesture has triggered inertia.

Gesture IDs

Constant Value Description
kGestureIDBegin 1 Begin of a gesture
kGestureIDEnd 2 End of a gesture
kGestureIDPan 4 Pan gesture
kGestureIDPressAndTap 7 Press and Tap gesture
kGestureIDRotate 5 Rotate gesture
kGestureIDTwoFingerTap 6 Two-Finger Tap
kGestureIDZoom 3 Zoom gesture

This class has no subclasses.

Blog Entries

Some events using this class:

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS Win Plugin.


WinGestureConfigMBS   -   WinHIDMBS


The biggest plugin in space...