Bearbeiten

Freigeben über


DwellHandler Class

Definition

Use this component to add a Dwell modality (https://docs.microsoft.com/windows/mixed-reality/gaze-and-dwell) to the UI target.

public ref class DwellHandler : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Input::IMixedRealityFocusChangedHandler, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/DwellHandler")]
public class DwellHandler : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.Input.IMixedRealityFocusChangedHandler, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/DwellHandler")>]
type DwellHandler = class
    inherit MonoBehaviour
    interface IMixedRealityFocusChangedHandler
    interface IEventSystemHandler
Public Class DwellHandler
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealityFocusChangedHandler
Inheritance
UnityEngine.MonoBehaviour
DwellHandler
Attributes
UnityEngine.AddComponentMenuAttribute
Implements
IMixedRealityFocusChangedHandler UnityEngine.EventSystems.IEventSystemHandler

Constructors

DwellHandler()

Fields

dwellProfile

Properties

CurrentDwellState

Captures the dwell status

DwellCanceled

The event to trigger when losing focus while being in the dwell started state

DwellCompleted

The event to trigger when being focused longer than the TimeToCompleteDwell after the DwellStartDelay

DwellIntended

The event to trigger when being focused longer than the DwellIntentDelay

DwellProfile

The profile to use with this handler

DwellProgress

Property exposing the computation for what percentage of dwell has progressed, ranging from 0 to 1.

DwellStarted

The event to trigger when being focused longer than the DwellStartDelay after the DwellIntentDelay

FillTimer

Abstracted value for the how long the dwelled object still needs to be focused to complete the dwell action Value ranges from 0 to "TimeToCompleteDwell" setting in the dwellprofile. This picks up the same unit as TimeToCompleteDwell

HasFocus

Exposes whether the target has focus from the pointer type defined in dwell profile settings

Methods

CancelDwell()

Method that can be invoked if external factors (e.g. alternate input modality preemptively invoked the target) force the dwell action to prematurely end

GetCurrentDwellProgress()

Get the current progess of dwell. Return value ranges from 0 to 1.

OnBeforeFocusChange(FocusEventData)

Focus event that is raised before the focus is actually changed.

OnFocusChanged(FocusEventData)

Focus event that is raised when the focused object is changed.

UpdateFillTimer()

Default FillTimer computation based on profile settings

Applies to