Partager via


Direct Manipulation Gestures (Compact 2013)

3/26/2014

Direct manipulation gestures provide an application with more control than other gesture types, as long as the hardware and driver can provide exact position information for multi-touch (that is, real multi-touch instead of symmetric). Only direct manipulation gestures can provide exact position information for two fingers. For example, direct manipulation gestures can provide the basis for a rotate gesture.

The gesture ID for direct manipulation is GID_DIRECTMANIPULATION.

Important

When you enable direct manipulation gestures, you cannot use the default gesture handler (AutoGesture), and you must disable pan and scroll gestures. The application must detect and handle pan and scroll gestures, and the direct manipulation gesture provides enough information to the application that it can.

The following example code shows how to disable pan and scroll and then enable direct manipulation.

DisableGestures(hWnd, TGF_GID_PAN | TGF_GID_SCROLL, TGF_SCOPE_WINDOW);

EnableGestures(hWnd, TGF_GID_DIRECTMANIPULATION, TGF_SCOPE_WINDOW);

For direct manipulation gesture events, the ptsLocation member of GESTUREINFO provides finger position information. For single-touch it holds the position of the finger. In true (instead of symmetric) multi-touch, ptsLocation holds the position of the primary contact point and ullArguments holds the x and y differences between the primary and secondary contact points.

In This Section

See Also

Concepts

Process Gesture Messages