SpatialInteractionManager SpatialInteractionManager SpatialInteractionManager SpatialInteractionManager Class

Definition

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

public : sealed class SpatialInteractionManager : ISpatialInteractionManagerpublic sealed class SpatialInteractionManager : ISpatialInteractionManagerPublic NotInheritable Class SpatialInteractionManager Implements ISpatialInteractionManager// You can use this class in JavaScript.
Attributes
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)

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 hands, voice and controllers.

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

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.

Methods

GetDetectedSourcesAtTimestamp(PerceptionTimestamp) GetDetectedSourcesAtTimestamp(PerceptionTimestamp) GetDetectedSourcesAtTimestamp(PerceptionTimestamp) GetDetectedSourcesAtTimestamp(PerceptionTimestamp)

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

public : IVectorView<SpatialInteractionSourceState> GetDetectedSourcesAtTimestamp(PerceptionTimestamp timeStamp)public IReadOnlyList<SpatialInteractionSourceState> GetDetectedSourcesAtTimestamp(PerceptionTimestamp timeStamp)Public Function GetDetectedSourcesAtTimestamp(timeStamp As PerceptionTimestamp) As IReadOnlyList( Of SpatialInteractionSourceState )// You can use this method in JavaScript.
Parameters
timeStamp
PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp

The time to query for the state of interaction sources.

Returns
IVectorView<SpatialInteractionSourceState> IReadOnlyList<SpatialInteractionSourceState> IReadOnlyList<SpatialInteractionSourceState> IReadOnlyList<SpatialInteractionSourceState>

The detected source states.

GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()

Get the SpatialInteractionManager associated with the current CoreWindow.

public : static SpatialInteractionManager GetForCurrentView()public static SpatialInteractionManager GetForCurrentView()Public Static Function GetForCurrentView() As SpatialInteractionManager// You can use this method in JavaScript.
Returns

Events

InteractionDetected InteractionDetected InteractionDetected InteractionDetected

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

Pass the SpatialInteraction object in the event arguments to the SpatialGestureRecognizer.CaptureInteraction method to route this interaction to that gesture recognizer.

public : event TypedEventHandler InteractionDetected<SpatialInteractionManager,  SpatialInteractionDetectedEventArgs>public event TypedEventHandler InteractionDetected<SpatialInteractionManager,  SpatialInteractionDetectedEventArgs>Public Event InteractionDetected<SpatialInteractionManager,  SpatialInteractionDetectedEventArgs>// You can use this event in JavaScript.

SourceDetected SourceDetected SourceDetected SourceDetected

Occurs when a new hand, motion controller, or source of voice commands has been detected.

public : event TypedEventHandler SourceDetected<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>public event TypedEventHandler SourceDetected<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>Public Event SourceDetected<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>// You can use this event in JavaScript.

SourceLost SourceLost SourceLost SourceLost

Occurs when a hand, motion controller, or source of voice commands is no longer available.

public : event TypedEventHandler SourceLost<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>public event TypedEventHandler SourceLost<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>Public Event SourceLost<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>// You can use this event in JavaScript.

SourcePressed SourcePressed SourcePressed SourcePressed

Occurs when a hand, motion controller, or source of voice commands has entered a pressed state.

public : event TypedEventHandler SourcePressed<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>public event TypedEventHandler SourcePressed<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>Public Event SourcePressed<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>// You can use this event in JavaScript.

Remarks

Inspect the PressKind to determine the nature of the press.

SourceReleased SourceReleased SourceReleased SourceReleased

Occurs when a hand, motion controller, or source of voice commands has exited a pressed state.

public : event TypedEventHandler SourceReleased<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>public event TypedEventHandler SourceReleased<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>Public Event SourceReleased<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>// You can use this event in JavaScript.

Remarks

Inspect the PressKind to determine the nature of the release.

SourceUpdated SourceUpdated SourceUpdated SourceUpdated

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

public : event TypedEventHandler SourceUpdated<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>public event TypedEventHandler SourceUpdated<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>Public Event SourceUpdated<SpatialInteractionManager,  SpatialInteractionSourceEventArgs>// You can use this event in JavaScript.