Version: 5.5 (switch to 5.6b)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

GestureRecognizer

class in UnityEngine.VR.WSA.Input

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Manager class with API for recognizing user gestures.

GestureRecognizer 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 when the user releases their finger. For more details on the types of gestures available see GestureSettings.

GestureRecognizers will only receive events after StartCapturingGestures is called. StopCapturingGestures can be called again to stop events. This allows for GestureRecognizer to be activated and deactivated on demand such as when a users gaze moves over and away from an object.

Constructors

GestureRecognizerCreate a GestureRecognizer.

Public Functions

CancelGesturesCancels any pending gesture events. Additionally this will call StopCapturingGestures.
DisposeDisposes the resources used by gesture recognizer.
GetRecognizableGesturesRetrieve a mask of the currently enabled gestures.
IsCapturingGesturesUsed to query if the GestureRecognizer is currently receiving Gesture events.
SetRecognizableGesturesSet the recognizable gestures to the ones specified in newMaskValues and return the old settings.
StartCapturingGesturesCall to begin receiving gesture events on this recognizer. No events will be received until this method is called.
StopCapturingGesturesCall to stop receiving gesture events on this recognizer.

Delegates

GestureErrorDelegateCallback indicating an error or warning occurred.
HoldCanceledEventDelegateCallback indicating a cancel event.
HoldCompletedEventDelegateCallback indicating a hold completed event.
HoldStartedEventDelegateCallback indicating a hold started event.
ManipulationCanceledEventDelegateCallback indicating a cancel event.
ManipulationCompletedEventDelegateCallback indicating a completed event.
ManipulationStartedEventDelegateCallback indicating a started event.
ManipulationUpdatedEventDelegateCallback indicating a updated event.
NavigationCanceledEventDelegateCallback indicating a cancel event.
NavigationCompletedEventDelegateCallback indicating a completed event.
NavigationStartedEventDelegateCallback indicating a started event.
NavigationUpdatedEventDelegateCallback indicating a update event.
RecognitionEndedEventDelegateCallback indicating the gesture event has completed.
RecognitionStartedEventDelegateCallback indicating the gesture event has started.
TappedEventDelegateCallback indicating a tap event.