SpatialGestureRecognizer SpatialGestureRecognizer SpatialGestureRecognizer SpatialGestureRecognizer SpatialGestureRecognizer Class


Interprets user interactions from hands, motion controllers, and system voice commands to surface spatial gesture events, which users target using their gaze or a motion controller's pointing ray.

public : sealed class SpatialGestureRecognizer
struct winrt::Windows::UI::Input::Spatial::SpatialGestureRecognizer
public sealed class SpatialGestureRecognizer
Public NotInheritable Class SpatialGestureRecognizer
var spatialGestureRecognizer = new spatialGestureRecognizer(settings);

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)


Spatial gestures are a key form of input for Mixed Reality headsets such as HoloLens. By routing interactions from the SpatialInteractionManager to a hologram's SpatialGestureRecognizer, apps can detect Tap, Hold, Manipulation, and Navigation events uniformly across hands, voice, and motion controllers.

Note that spatial gestures are not detected for input from gamepads, keyboards or mice.

SpatialGestureRecognizer performs only the minimal disambiguation between the set of gestures that you request. For example, if you request just Tap, the user may hold their finger down as long as they like and a Tap will still occur. If you request both Tap and Hold, after about a second of holding down their finger, the gesture will promote to a Hold and a Tap will no longer occur.

To use SpatialGestureRecognizer, handle the SpatialInteractionManager's InteractionDetected event and grab the SpatialPointerPose exposed there. Use the user's gaze ray from this pose to intersect with the holograms and surface meshes in the user's surroundings, in order to determine what the user is intending to interact with. Then, route the SpatialInteraction in the event arguments to the target hologram's SpatialGestureRecognizer, using its CaptureInteraction method. This starts interpreting that interaction according to the SpatialGestureSettings set on that recognizer at creation time or by TrySetGestureSettings.

When targeting a spatial interaction, such as a hand gesture, motion controller press or voice interaction, apps should choose a pointing ray available from the interaction's SpatialPointerPose, based on the nature of the interaction's SpatialInteractionSource:

  • If the interaction source does not support pointing (IsPointingSupported is false), the app should target based on the user's gaze, available through the Head property.
  • If the interaction source does support pointing (IsPointingSupported is true), the app may instead target based on the source's pointer pose, available through the TryGetInteractionSourcePose method.

The app should then intersect the chosen pointing ray with its own holograms or with the spatial mapping mesh to render cursors and determine what the user is intending to interact with.


SpatialGestureRecognizer(SpatialGestureSettings) SpatialGestureRecognizer(SpatialGestureSettings) SpatialGestureRecognizer(SpatialGestureSettings) SpatialGestureRecognizer(SpatialGestureSettings) SpatialGestureRecognizer(SpatialGestureSettings)

Initializes a new SpatialGestureRecognizer with the specified gesture settings.


GestureSettings GestureSettings GestureSettings GestureSettings GestureSettings

Gets the current SpatialGestureSettings for this recognizer.


CancelPendingGestures() CancelPendingGestures() CancelPendingGestures() CancelPendingGestures() CancelPendingGestures()

Cancels all in-progress gestures and abandons any captured interactions.

CaptureInteraction(SpatialInteraction) CaptureInteraction(SpatialInteraction) CaptureInteraction(SpatialInteraction) CaptureInteraction(SpatialInteraction) CaptureInteraction(SpatialInteraction)

Track all input events that occur as part of the specified interaction.

TrySetGestureSettings(SpatialGestureSettings) TrySetGestureSettings(SpatialGestureSettings) TrySetGestureSettings(SpatialGestureSettings) TrySetGestureSettings(SpatialGestureSettings) TrySetGestureSettings(SpatialGestureSettings)

Attempts to change the gesture settings for this recognizer.


HoldCanceled HoldCanceled HoldCanceled HoldCanceled HoldCanceled

Occurs when a Hold gesture is canceled.

HoldCompleted HoldCompleted HoldCompleted HoldCompleted HoldCompleted

Occurs when a Hold gesture completes.

HoldStarted HoldStarted HoldStarted HoldStarted HoldStarted

Occurs when an interaction becomes a Hold gesture.

ManipulationCanceled ManipulationCanceled ManipulationCanceled ManipulationCanceled ManipulationCanceled

Occurs when a Manipulation gesture is canceled.

ManipulationCompleted ManipulationCompleted ManipulationCompleted ManipulationCompleted ManipulationCompleted

Occurs when a Manipulation gesture is completed.

ManipulationStarted ManipulationStarted ManipulationStarted ManipulationStarted ManipulationStarted

Occurs when an interaction becomes a Manipulation gesture.

ManipulationUpdated ManipulationUpdated ManipulationUpdated ManipulationUpdated ManipulationUpdated

Occurs when a Manipulation gesture is updated due to hand movement.

NavigationCanceled NavigationCanceled NavigationCanceled NavigationCanceled NavigationCanceled

Occurs when a Navigation gesture is canceled.

NavigationCompleted NavigationCompleted NavigationCompleted NavigationCompleted NavigationCompleted

Occurs when a Navigation gesture is completed.

NavigationStarted NavigationStarted NavigationStarted NavigationStarted NavigationStarted

Occurs when an interaction becomes a Navigation gesture.

NavigationUpdated NavigationUpdated NavigationUpdated NavigationUpdated NavigationUpdated

Occurs when a Navigation gesture is updated due to hand or motion controller movement.

RecognitionEnded RecognitionEnded RecognitionEnded RecognitionEnded RecognitionEnded

Occurs when gesture recognition ends, due to completion or cancellation of a gesture (this is the last event to fire).

RecognitionStarted RecognitionStarted RecognitionStarted RecognitionStarted RecognitionStarted

Occurs when gesture recognition begins (this is the first event to fire).

Tapped Tapped Tapped Tapped Tapped

Occurs when a Tap or DoubleTap gesture is recognized.

See also