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. |
Touch gestures describe gestures in which you use a finger or stylus to make a short, directional movement over a control or object on the screen. Most gestures are a single stroke. Therefore, they correspond to one finger–down ( WM_LBUTTONDOWN) and finger–up ( WM_LBUTTONUP) event pair. The exception is double tap, in which there are two finger–down and finger–up event pairs in short succession. Gestures are recognized based on finger–down and finger–up events, plus the direction, position, and velocity calculated by the gesture recognizer. Windows Mobile supports five kinds of gestures.
Gesture | Description |
---|---|
Tap |
A tap represents the left click of a mouse. The application receives a single GID_SELECT gesture message when the finger–down and finger–up events occur in a defined time period and a specific distance from each other. There can be several WM_MOUSEMOVEmessages after the WM_LBUTTONDOWN event and before the GID_SELECT message. |
Double Tap |
A double tap represents the left double click of a mouse. The application receives a GID_DOUBLESELECT gesture message when the finger–up events occur in a defined time period and within a specific distance of each other. |
Hold |
The user can press and hold on the screen to represent the right click of a mouse. The application receives a single GID_HOLD message when the finger remains down for longer than a defined time period and all points during that period are within a specific distance. It is followed by a GID_END message on finger–up or at the end of the Hold time threshold. |
Flick |
The user can move a finger across the screen to initiate per-pixel scrolling, and if this movement is fast enough, scrolling will continue after the finger is lifted. The application receives a single GID_SCROLL gesture message at the end of the movement upon finger-up. A flick frequently occurs after a pan (one or more GID_PAN gesture messages, followed by a GID_SCROLL message, and then a GID_END message). |
Pan |
The user can press and hold on the screen and then drag the finger in any direction to represent a mouse move event. The application receives one or more GID_PAN gesture messages as the position changes followed by a GID_END when the finger is lifted. Mouse messages are interleaved with gesture messages. Panning can occur after a Hold gesture. |
For more information about the GID_* gesture messages, see GESTUREINFO.
The system architecture of the gesture recognition engine consists of a gesture-recognizing state machine attached to the existing touch event delivery routine. Touch events are routed from the touch screen drivers into the state machine. When a gesture is recognized, a gesture window message is posted to the message queue of the target process.
Note: |
---|
Calling SetCapturewill change the target window for gestures. |
Gesture events are always delivered before any final finger–up event so that the receiver can process the gesture by calling TKGetGestureInfoand cancel any action planned for the finger–up touch event.
Window Auto Gestures
Auto gestures enable controls and applications within a window to automatically handle flick and pan gestures. You can control the gesture handling by using the functions TKSetWindowAutoGestureand TKGetWindowAutoGesture. Auto gestures cause animation messages to be sent to the window procedure to manage the animations associated with flicks and pans. You can retrieve those messages by calling TKGetAnimateMessageInfo.