docs.unity3d.com
    Show / Hide Table of Contents

    Class OpenXRInput

    OpenXR Input related functionality.

    Inheritance
    Object
    OpenXRInput
    Namespace: UnityEngine.XR.OpenXR.Input
    Syntax
    public static class OpenXRInput : object

    Methods

    SendHapticImpulse(InputAction, Single, Single, InputSystem.InputDevice)

    Send a haptic impulse using the given action

    Declaration
    public static void SendHapticImpulse(InputAction action, float amplitude, float duration, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputAction action

    Action to send haptic impulse through

    Single amplitude

    Amplitude of the impulse [0-1]

    Single duration

    Duration of the impulse [0-]

    InputSystem.InputDevice inputDevice

    Optional device to limit haptic impulse to

    SendHapticImpulse(InputAction, Single, Single, Single, InputSystem.InputDevice)

    Send a haptic impulse using the given action

    Declaration
    public static void SendHapticImpulse(InputAction action, float amplitude, float frequency, float duration, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputAction action

    Action to send haptic impulse through

    Single amplitude

    Amplitude of the impulse [0-1]

    Single frequency

    Frequency of the impulse in hertz (Hz). (Typical frequency values are between 0 and 300Hz) (0 = default). Note that not all runtimes support frequency.

    Single duration

    Duration of the impulse [0-]

    InputSystem.InputDevice inputDevice

    Optional device to limit haptic impulse to

    SendHapticImpulse(InputActionReference, Single, Single, InputSystem.InputDevice)

    Send a haptic impulse using an action reference

    Declaration
    public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float duration, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputActionReference actionRef

    Action Reference to send haptic impulse through

    Single amplitude

    Amplitude of the impulse [0-1]

    Single duration

    Duration of the impulse [0-]

    InputSystem.InputDevice inputDevice

    Optional device to limit haptic impulse to

    SendHapticImpulse(InputActionReference, Single, Single, Single, InputSystem.InputDevice)

    Send a haptic impulse using an action reference

    Declaration
    public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float frequency, float duration, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputActionReference actionRef

    Action Reference to send haptic impulse through

    Single amplitude

    Amplitude of the impulse [0-1]

    Single frequency

    Frequency of the impulse in hertz (Hz). (Typical frequency values are between 0 and 300Hz) (0 = default). Note that not all runtimes support frequency.

    Single duration

    Duration of the impulse [0-]

    InputSystem.InputDevice inputDevice

    Optional device to limit haptic impulse to

    StopHaptics(InputAction, InputSystem.InputDevice)

    Stop any haptics playing for the given action

    Declaration
    public static void StopHaptics(InputAction inputAction, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputAction inputAction

    Input action to stop haptics for

    InputSystem.InputDevice inputDevice

    Optional device filter for actions bound to multiple defices

    StopHaptics(InputActionReference, InputSystem.InputDevice)

    Stop any haptics playing for the given action reference

    Declaration
    public static void StopHaptics(InputActionReference actionRef, InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputActionReference actionRef

    Action reference to stop the haptics on.

    InputSystem.InputDevice inputDevice

    Optional device filter for actions bound to multiple devices.

    TryGetInputSourceName(InputAction, Int32, out String, OpenXRInput.InputSourceNameFlags, InputSystem.InputDevice)

    Return the name of the input source bound to the given action

    Declaration
    public static bool TryGetInputSourceName(InputAction inputAction, int index, out string name, OpenXRInput.InputSourceNameFlags flags = default(OpenXRInput.InputSourceNameFlags), InputSystem.InputDevice inputDevice = null)
    Parameters
    Type Name Description
    InputAction inputAction

    Input Action

    Int32 index

    Index of the input source in the case of multiple bindings.

    String name

    Name of the input source if an input source was found or an empty string if none was found

    OpenXRInput.InputSourceNameFlags flags

    Flags that indicate which parts of the input source name are requested.

    InputSystem.InputDevice inputDevice

    Optional input device to limit search to

    Returns
    Type Description
    Boolean

    True if an input source was found

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023