Partager via


Recognize a Gesture (Compact 2013)

3/26/2014

For a direct manipulation window, the active recognizer for a gesture session is a DMRecognizer object. For a window that is not a direct manipulation window the active recognizer is a TouchGesture object. Both of these objects implement these public methods: OnBeginGestureSession, OnEndGestureSession, and HandleTouchEvent. DMRecognizer also implements OnHoldComplete and IsDMWindow.

The following table describes the calls made to active recognizer methods.

Caller

Called method

Description

GestureRecognizer::OnBeginSession

OnBeginGestureSession

A call occurs when a new gesture session starts (for example, on contact down for the primary contact point).

GestureRecognizer::RecognizeGesture

HandleTouchEvent

A call occurs whenever GestureRecognizer::RecognizeGesture receives a touch event from gesture core. When a session starts, GestureRecognizer::BeginSession calls OnBeginGestureSession before GestureRecognizer::RecognizeGesture calls HandleTouchEvent.

GestureRecognizer::EndSession

OnEndGestureSession

A call occurs when the last touch contact is gone from the tracking list, or when there is an error. In this case, GestureRecognizer::RecognizeGesture calls GestureRecognizer::Endsession, which, in turn, calls OnEndGestureSession.

OnHoldComplete

Not called.

GestureRecognizer::BeginSession

IsDMWindow

A call occurs when a new gesture session starts, to determine whether the active recognizer should be a DMRecognizer object or a TouchGesture object.

See Also

Concepts

Gesture Recognizer Session