Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The GESTUREINFO structure is filled out by TKGetGestureInfoand provides full details of the gesture.

Syntax

typedef struct tagGESTUREINFO {
	UINT 
cbSize;
	DWORD 
dwFlags;
	DWORD 
dwID;
		HWND 
hwndTarget;
	POINTS 
ptsLocation;
	DWORD 
dwInstanceID;
	DWORD 
dwSequenceID;
	ULONGLONG 
ullArguments;
	UINT 
cbExtraArguments;
} GESTUREINFO, *PGESTUREINFO;

Parameters

cbSize

Size of the structure. This must be initialized to sizeof(GESTUREINFO)before you call TKGetGestureInfo.

dwFlags

Contains the gesture flags. Possible values include:

GF_BEGIN

GF_END

GF_END | GF_INERTIA

dwID

The gesture command. For a list of defined gestures, see the Remarks section, below.

hwndTarget

The handle of the target window that should receive the gestures.

ptsLocation

POINTSstructure that contains the screen coordinates associated with the gesture.

dwInstanceID

Not used.

dwSequenceID

The time stamp of the gesture.

Applications can use this value to account for the latency between gestures (in particular, between a flick and a pan).

ullArguments

Information associated with the command. The argument values packed into this field depend on the gesture command.

cbExtraArguments

Size of the extra arguments returned by GetGestureExtraArguments.

Remarks

The following gesture commands are recognized by the Gesture Engine.

GID_BEGIN

Contains the coordinates that mark the starting point of each touch gesture. This is sent when gesture recognition has begun. This may or may not be some time after the screen is touched.

GID_END

Contains the coordinates that mark the end point of each touch gesture. This is sent gesture recognition is complete.

The ullArgumentsfield is always set to zero for this command.

GID_PAN

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_PANmessage that contains the starting point and the current point of the gesture. GID_PANmessages are sent regularly until the finger or stylus is lifted from the window. GID_ENDis 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_INERTIAflag is set, the value of ullArguments is the same as for GID_SCROLL.

GID_SCROLL

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_SCROLLmessage after a flick gesture.

The ullArgumentsfield contains information about the angle, direction and velocity of the flick.

The core directions are represented by the following values:

#define ARG_SCROLL_NONE

#define ARG_SCROLL_RIGHT

#define ARG_SCROLL_UP

#define ARG_SCROLL_LEFT

#define 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.

Copy Code
#define GID_SCROLL_ANGLE (x)
#define GID_SCROLL_DIRECTION (x)
#define GID_SCROLL_VELOCITY (x)

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

Copy Code
#define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_)
#define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_)

To convert the raw angle to degrees, divide the raw angle by 32768, then multiply that value by 360/32768. 32768 units represent one full circle.

The raw angle is given relative to the current system orientation (agnostic of whether the device is in landscape or portrait mode). When the system rotates, the gesture directions and angles adjust to match the rotation.

The GID_SCROLLis 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.

GID_HOLD

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_HOLDgesture message, and follows it with a GID_ENDmessage when the finger or stylus is lifted.

The HOLD gesture can be followed by a panning movement that generates several GID_PANmessages, but the GID_HOLDmessage is never issued after a GID_PANmessage.

The ullArgumentsfield is not used for this command.

GID_SELECT

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 ullArgumentsfield is not used for this command.

GID_DOUBLESELECT

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 ullArgumentsfield is not used for this command.

Requirements

Windows Mobile Windows Mobile 6.5 and later