docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MicrogestureSwipeControl

    Represents the thumb swipe microgesture as a normalized 2D direction, with each direction also available as a button.

    Inheritance
    object
    InputControl
    InputControl<Vector2>
    Vector2Control
    MicrogestureSwipeControl
    Inherited Members
    Vector2Control.EvaluateMagnitude(void*)
    Vector2Control.CalculateOptimizedControlDataType()
    Vector2Control.x
    Vector2Control.y
    InputControl<Vector2>.ReadValue()
    InputControl<Vector2>.ReadValueFromPreviousFrame()
    InputControl<Vector2>.ReadDefaultValue()
    InputControl<Vector2>.ReadValueFromState(void*)
    InputControl<Vector2>.ReadValueFromStateWithCaching(void*)
    InputControl<Vector2>.ReadUnprocessedValueFromStateWithCaching(void*)
    InputControl<Vector2>.ReadUnprocessedValue()
    InputControl<Vector2>.ReadValueFromStateAsObject(void*)
    InputControl<Vector2>.ReadValueFromStateIntoBuffer(void*, void*, int)
    InputControl<Vector2>.WriteValueFromBufferIntoState(void*, int, void*)
    InputControl<Vector2>.WriteValueFromObjectIntoState(object, void*)
    InputControl<Vector2>.ReadValueFromBufferAsObject(void*, int)
    InputControl<Vector2>.CompareValue(void*, void*)
    InputControl<Vector2>.ProcessValue(Vector2)
    InputControl<Vector2>.ProcessValue(ref Vector2)
    InputControl<Vector2>.valueType
    InputControl<Vector2>.valueSizeInBytes
    InputControl<Vector2>.value
    InputControl.m_StateBlock
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.TryGetChildControl(string)
    InputControl.TryGetChildControl<TControl>(string)
    InputControl.GetChildControl(string)
    InputControl.GetChildControl<TControl>(string)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.ApplyParameterChanges()
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.this[string]
    InputControl.magnitude
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    InputControl.optimizedControlDataType
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Hands
    Assembly: Unity.XR.Hands.dll
    Syntax
    [Preserve]
    [InputControlLayout(displayName = "Microgesture Swipe")]
    public class MicrogestureSwipeControl : Vector2Control
    Remarks

    When the runtime recognizes a thumb swipe, the matching direction button becomes pressed. The value is the normalized sum of the pressed directions' vectors: left for swipeLeft, right for swipeRight, up for swipeForward, and down for swipeBackward. When no direction button is pressed, the value is zero.

    To respond to each swipe, use the performed callback or WasPerformedThisFrame() on an action bound to this control, rather than polling the value.

    Constructors

    MicrogestureSwipeControl()

    Creates a new thumb swipe microgesture control.

    Declaration
    public MicrogestureSwipeControl()
    Remarks

    The Input System creates this control from the device layout. You don't need to call this constructor.

    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    Properties

    swipeBackward

    The button that's pressed when the runtime recognizes a thumb swipe backward.

    Declaration
    [InputControl(offset = 0, bit = 3, displayName = "Swipe Backward")]
    public ButtonControl swipeBackward { get; set; }
    Property Value
    Type Description
    ButtonControl
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    swipeForward

    The button that's pressed when the runtime recognizes a thumb swipe forward.

    Declaration
    [InputControl(offset = 0, bit = 2, displayName = "Swipe Forward")]
    public ButtonControl swipeForward { get; set; }
    Property Value
    Type Description
    ButtonControl
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    swipeLeft

    The button that's pressed when the runtime recognizes a thumb swipe to the left.

    Declaration
    [InputControl(name = "x", layout = "MicrogestureSwipeAxis", offset = 0, bit = 0, sizeInBits = 4, format = "BIT", synthetic = true)]
    [InputControl(name = "y", layout = "MicrogestureSwipeAxis", offset = 0, bit = 0, sizeInBits = 4, format = "BIT", synthetic = true)]
    [InputControl(offset = 0, bit = 0, displayName = "Swipe Left")]
    public ButtonControl swipeLeft { get; set; }
    Property Value
    Type Description
    ButtonControl
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    swipeRight

    The button that's pressed when the runtime recognizes a thumb swipe to the right.

    Declaration
    [InputControl(offset = 0, bit = 1, displayName = "Swipe Right")]
    public ButtonControl swipeRight { get; set; }
    Property Value
    Type Description
    ButtonControl
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    Methods

    FinishSetup()

    Completes initialization after the control hierarchy is in place.

    Declaration
    protected override void FinishSetup()
    Overrides
    Vector2Control.FinishSetup()
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    ReadUnprocessedValueFromState(void*)

    Reads the value of the control from the given state, without applying processors.

    Declaration
    public override Vector2 ReadUnprocessedValueFromState(void* statePtr)
    Parameters
    Type Name Description
    void* statePtr

    State containing the control's state block.

    Returns
    Type Description
    Vector2

    The swipe direction, or zero if no swipe is active.

    Overrides
    Vector2Control.ReadUnprocessedValueFromState(void*)
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    WriteValueIntoState(Vector2, void*)

    Writes the given swipe direction into the given state by setting the matching direction button.

    Declaration
    public override void WriteValueIntoState(Vector2 value, void* statePtr)
    Parameters
    Type Name Description
    Vector2 value

    The swipe direction to write, such as left, or zero for no swipe.

    void* statePtr

    State containing the control's state block.

    Overrides
    Vector2Control.WriteValueIntoState(Vector2, void*)
    See Also
    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)

    See Also

    microgestureSwipe
    IsMicrogestureActive(XRHandMicrogesture)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)