Gesture Commands (Compact 2013)

3/28/2014

The gesture API defines the following gesture commands, in addition to any custom gestures that you register with RegisterGesture.

  • GID_BEGIN
    Marks the beginning of each touch gesture, when the user first touches the screen.
  • GID_END
    Marks the end of each touch gesture, when the user lifts their finger from the screen.
  • GID_PAN
    A pan gesture occurs when the user touches the screen and moves their finger in any direction. This represents a mouse move event.

    When the finger moves a distance equal to or greater than the pan threshold, the gesture recognizer sends an initial GID_PAN message that contains the current location of the finger. For more information about defining the pan threshold, see GESTUREMETRICS.

    The gesture recognizer sends a new GID_PAN message for each mouse move message until the user lifts up their finger. GID_END marks the end of the pan movement. Mouse messages are interleaved for backward compatibility, but the gesture messages are always received before the corresponding mouse events.

    You can calculate the movement delta by comparing two consecutive pan messages.

    Panning can occur after a hold gesture.

  • GID_ROTATE
    Reserved.
  • GID_SCROLL
    A flick gesture occurs when the user touches their finger to the screen and then moves the finger quickly in any direction before lifting the finger.

    The gesture recognizer sends the GID_SCROLL message after a flick.

    The ullArguments member of GESTUREINFO contains the following information:

    • Direction   You can use the GID_SCROLL_DIRECTION(x) macro to retrieve the direction. The direction is one of the following values:
      • ARG_SCROLL_NONE
      • ARG_SCROLL_DOWN
      • ARG_SCROLL_LEFT
      • ARG_SCROLL_UP
      • ARG_SCROLL_RIGHT
    • **Velocity   **You can use the GID_SCROLL_VELOCITY(x) macro to retrieve the velocity, in pixels per second.
    • Angle   You can use the GID_SCROLL_ANGLE(x) macro to retrieve the angle as an unsigned, 16-bit integer. You can use the GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_) macro to convert the angle to radians.

    The gesture recognizer sends the GID_SCROLL message to the window that received the first gesture message, usually a pan or a hold message, for the current touch session.

    A flick frequently occurs after a pan (one or more GID_PAN gesture messages followed by a GID_END message immediately before the flick).

  • GID_HOLD
    A hold gesture occurs when the user touches the screen and holds their finger down for more than the hold time-out period. This represents the right click of a mouse.

    The gesture recognizer sends a GID_HOLD gesture message and then sends a GID_END message when the user lifts their finger or at the end of the hold time threshold.

    The hold gesture can be followed by a panning movement that generates several GID_PAN messages, but the gesture recognizer never sends a GID_HOLD message after a GID_PAN message. The gesture recognizer always sends a GID_HOLD message first after the user touches the screen, if the gesture parameters meet the hold time-out recognition values.

    For more information about defining the hold time-out period, see GESTUREMETRICS.

  • GID_SELECT
    A select, or tap, gesture occurs when the user taps on the screen for a period of time that is less than the hold time-out period. A tap represents the left click of a mouse.

    There can be several WM_MOUSEMOVE messages after the WM_LBUTTONDOWN event and before the GID_SELECT message.

  • GID_DOUBLESELECT
    A double select, or double tap, gesture occurs when the user taps twice on the screen within a period of time that is less than the hold time-out period. A double tap represents the left double-click of a mouse.
  • GID_DIRECTMANIPULATION
    Objects on the screen react so that the same point on an object always remains underneath the same finger. Direct manipulation maps points in an object's local space and points in screen space, without the need for gesture processing. During direct manipulation, the gesture recognizer does not send GID_* messages.

Requirements

Header

winuser.h

sysgen

SYSGEN_TOUCHGESTURE

See Also

Reference

Gesture Reference
Gesture Commands
GESTUREINFO
WM_GESTURE