Gesture flags

Gesture flags provide status for MSGestureEvent objects.

MSGESTURE_FLAG_NONE
0

Normal status.

MSGESTURE_FLAG_BEGIN
1

The gesture event has started.

MSGESTURE_FLAG_END
2

The gesture event has ended.

MSGESTURE_FLAG_CANCEL
4

The gesture event has been cancelled. This often comes ANDed with MSGESTURE_FLAG_END.

MSGESTURE_FLAG_INERTIA
8

The gesture is in its inertia phase. This flag will be continuously sent through a MSGestureChange event while an element on the screen is moving.

Remarks

The MSGesture flags return the status of an event object, such as MSGestureStart, MSGestureChange, or MSGestureHold. For example, if a user swipes their finger on the screen, the event events and details will be as follows:

  • The MSGestureStart event fires, with the MSGESTURE_FLAG_BEGIN flag.
  • As the user moves their finger, the MSGestureChange event fires repeatedly with the MSGESTURE_FLAG_NONE being passed through the detail property.
  • When the user lifts their finger, the MSInertiaStart event fires, passing the MSGESTURE_FLAG_INERTIA flag.
  • As long as the element is still moving on the screen, the MSGestureChange element continues to fire with the MSGESTURE_FLAG_INERTIA flag being passed.
  • When the movement comes to an end, the MSGestureEnd event fires and two flags are passed with the detail property, MSGESTURE_FLAG_INERTIA and MSGESTURE_FLAG_END flags.

If a user touches the screen and holds for a few seconds, and then moves their finger, the events and details will go like this:

  • After several seconds, the MSGestureHold event fires, passing the MSGESTURE_FLAG_BEGIN flag.
  • When the user starts moving their finger, the MSGestureHold event fires, passing MSGESTURE_FLAG_END, and the MSGESTURE_FLAG_CANCEL flags. This signals that the hold has been cancelled.
  • As the user moves their finger, the MSGestureChange event fires repeatedly with the MSGESTURE_FLAG_NONE being passed through the detail property. The rest of the sequence continues like the swipe described above.
  • When the user lifts their finger, the MSInertiaStart event fires, passing the MSGESTURE_FLAG_INERTIA flag.
  • As long as the element is still moving on the screen, the MSGestureChange element continues to fire with the MSGESTURE_FLAG_INERTIA flag being passed.
  • When the movement comes to an end, the MSGestureEnd event fires and two flags are passed with the detail property, MSGESTURE_FLAG_INERTIA and MSGESTURE_FLAG_END flags.

Requirements

 

 

Show:
© 2014 Microsoft