Gesture Macros (Compact 2013)

3/28/2014

The following macros are available for use with the gesture API:

Name

Value

Description

GID_DIRECTMANIPULATION_DELTA_X(x)

((SHORT)(LOWORD((ULONG)((x) & 0xffffffff))))

Retrieves the distance between two X coordinates for direct manipulation.

GID_DIRECTMANIPULATION_DELTA_Y(x)

((SHORT)(HIWORD((ULONG)((x) & 0xffffffff))))

Retrieves the distance between two Y coordinates for direct manipulation.

GID_IS_BUILTIN_GESTURE(x)

(((x)>GID_END)&&((x)<=GID_LAST))

Indicates if a gesture ID is a predefined gesture command.

GID_PAN_CONTACT_SEPARATION(x)

((LONG)(((ULONGLONG)(x)) >> 32))

Retrieves the distance between two contacts for a multitouch pan gesture.

GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_)

((USHORT)((((_arg_) + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65536.0))

Converts an angle from radians to an unsigned, 16-bit integer.

GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_)

((((double)(_arg_) / 65536.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265)

Converts an angle from an unsigned, 16-bit integer to radians.

GID_SCROLL_ANGLE(x)

(HIWORD((x)))

Retrieves the angle of a flick gesture as an unsigned, 16-bit integer from the ullArguments member of GESTUREINFO.

GID_SCROLL_DIRECTION(x)

(LOWORD((x)))

Retrieves the direction of a flick gesture from the ullArguments member of GESTUREINFO. The direction is one of the following values:

  • ARG_SCROLL_NONE
  • ARG_SCROLL_DOWN
  • ARG_SCROLL_LEFT
  • ARG_SCROLL_UP
  • ARG_SCROLL_RIGHT

GID_SCROLL_VELOCITY(x)

((LONG)(((ULONGLONG)(x)) >> 32))

Retrieves the velocity of a flick gesture, in pixels per second, from the ullArguments member of GESTUREINFO.

GID_TO_TGF(x)

(1ULL << (x))

Converts a gesture ID into a flag bit that you can use when you enable or disable gestures.

TOUCH_COORD_TO_PIXEL(l)

((l) / 100)

Converts touch input coordinates into pixels.

You can use the following macros when you enable or disable gestures for a window or process. For more information, see EnableGestures, DisableGestures, and QueryGestures.

Name

Value

Description

TGF_GID_PAN

GID_TO_TGF(GID_PAN)

Indicates a pan gesture.

TGF_GID_SCROLL

GID_TO_TGF(GID_SCROLL)

Indicates a flick gesture.

TGF_GID_HOLD

GID_TO_TGF(GID_HOLD)

Indicates a hold gesture.

TGF_GID_SELECT

GID_TO_TGF(GID_SELECT)

Indicates a select gesture.

TGF_GID_DOUBLESELECT

GID_TO_TGF(GID_DOUBLESELECT)

Indicates a double select gesture.

TGF_GID_DIRECTMANIPULATION

GID_TO_TGF(GID_DIRECTMANIPULATION)

Indicates direct manipulation of objects on the screen.

TGF_GID_ALL

(0xFFFFFFFFFFFFFFFFULL)

Indicates all registered gestures.

TGF_SCOPE_WINDOW

0

Indicates that gestures are enabled or disabled for a window.

TGF_SCOPE_PROCESS

1

Indicates that gestures are enabled or disabled for a process.

Requirements

Header

winuser.h

sysgen

SYSGEN_TOUCHGESTURE

See Also

Reference

Gesture Reference
GESTUREINFO