Gesture Constants (DTK)

4/8/2010

The following constants represent commands that are used by the GESTUREINFO struct.

Name Value Description

GID_BEGIN

1

Contains the coordinates that mark the starting point of each touch gesture. This is sent when the screen is touched.

GID_END

2

Contains the coordinates that mark the end point of each touch gesture. This is sent when the finger or stylus is lifted from the touch screen.

The ullArguments field of GESTUREINFO is always set to zero for this command.

GID_PAN

4

Panning occurs when the user presses on the window and moves in any direction while their finger maintains contact with the screen. The Recognition engine sends a GID_PAN message that contains the starting point and the current point of the gesture. A new GID_PAN message is sent for each mouse move message until the finger or stylus is lifted from the window. GID_END is issued to mark the end of the pan movement.

An application can calculate the movement delta from the difference between two consecutive pan gestures.

If the GF_INERTIA flag is set, the value of the ullArguments field of GESTUREINFO is the same as for GID_SCROLL.

GID_SCROLL

8

Scrolling occurs when the user presses on the window (and perhaps pans over the screen) and then motions rapidly in any direction, before lifting the finger or stylus at the end of the movement.

The Recognition engine sends the GID_SCROLL message after a flick gesture.

GID_SCROLL is sent to the window that received the first gesture message for the current touch session, which was likely a pan message or a hold message.

The ullArguments field of GESTUREINFO contains information about the angle, direction and velocity of the flick.

The core directions are represented by the following values:

  • ARG_SCROLL_NONE
  • ARG_SCROLL_RIGHT
  • ARG_SCROLL_UP
  • ARG_SCROLL_LEFT
  • ARG_SCROLL_DOWN

When the device rotates, the gestures adjust to match the rotation.

The angle of the flick is measured in values that range from 0 to 65535.

The following macros extract the angle, direction, and velocity from the raw angle:

You can convert between the raw angle and radians by using the following macros:

GID_ROTATE_ANGLE_TO_ARGUMENT

GID_ROTATE_ANGLE_FROM_ARGUMENT

GID_HOLD

9

Holding occurs when the user presses on the window and keeps the finger or stylus down for more than the hold timeout period.

The Recognition Engine sends a GID_HOLD gesture message, and follows it with a GID_END message when the finger or stylus is lifted.

The HOLD gesture can be followed by a panning movement that generates several GID_PAN messages, but the GID_HOLD message is never issued after a GID_PAN message

GID_SELECT

10

Selection occurs when the user taps on the screen with a finger or stylus in a period of time less than the select timeout period.

The ullArguments field of GESTUREINFO is not used for this command.

GID_DOUBLESELECT

11

Selection occurs when the user taps twice on the screen with a finger or stylus in a period of time less than the specified DOUBLESELECT timeout. This timeout is the time between consecutive mouse up events.

The ullArguments field of GESTUREINFO is not used for this command.

See Also

Other Resources

Using Gestures in Windows Mobile 6.5