SpatialInteractionManager Class

Definition

Provides access to user input from hands, motion controllers, and system voice commands.

public ref class SpatialInteractionManager sealed
class SpatialInteractionManager sealed
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Input.Spatial.ISpatialInteractionManagerStatics), 131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SpatialInteractionManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Input.Spatial.ISpatialInteractionManagerStatics), 131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Input.Spatial.ISpatialInteractionManagerStatics2), 524288, "Windows.Foundation.UniversalApiContract")]
public sealed class SpatialInteractionManager
Public NotInheritable Class SpatialInteractionManager
Inheritance
SpatialInteractionManager
Attributes

Windows 10 requirements

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

Remarks

Spatial gestures are a key form of input for HoloLens. By routing the interactions from the SpatialInteractionManager to a hologram's SpatialGestureRecognizer, apps can detect Tap, Hold, Manipulation, and Navigation events uniformly across hand, speech and controller interactions.

Note

Spatial interactions are not detected from gamepad, keyboard, or mouse input devices.

Interactions are mostly opaque, with an event triggering only at the beginning, so the gesture recognizer you route it to can capture the interaction in its entirety. Apps can instead choose to use the low-level Source events or poll using GetDetectedSourcesAtTimestamp to manually process the Presses, Updates, and Releases surfaced by a given hand or controller.

Version history

Windows version SDK version Value added
1903 18362 IsSourceKindSupported

Methods

GetDetectedSourcesAtTimestamp(PerceptionTimestamp)

Get the state of all interaction sources detected for the specified timestamp.

GetForCurrentView()

Get the SpatialInteractionManager associated with the current CoreWindow.

IsSourceKindSupported(SpatialInteractionSourceKind)

Gets whether the specified interaction source is supported on this device.

Events

InteractionDetected

Occurs when a new interaction is available for routing to a SpatialGestureRecognizer.

SourceDetected

Occurs when a new hand, motion controller, or speech source has been detected.

SourceLost

Occurs when a hand, motion controller, or speech source is no longer available.

SourcePressed

Occurs when a hand, motion controller, or speech source has entered a pressed state.

SourceReleased

Occurs when a hand, motion controller, or speech source has exited a pressed state.

SourceUpdated

Occurs when a hand, motion controller, or speech source has experienced a change to its SpatialInteractionSourceState.

Applies to

See also