docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRUIInputModule

    Custom class for input modules that send UI input in XR.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    UIBehaviour
    BaseInputModule
    UIInputModule
    XRUIInputModule
    Inherited Members
    UIInputModule.clickSpeed
    UIInputModule.moveDeadzone
    UIInputModule.repeatDelay
    UIInputModule.repeatRate
    UIInputModule.trackedDeviceDragThresholdMultiplier
    UIInputModule.trackedScrollDeltaMultiplier
    UIInputModule.nonTrackedScrollDeltaMultiplier
    UIInputModule.bypassUIToolkitEvents
    UIInputModule.uiCamera
    UIInputModule.prioritizeDistanceSorting
    UIInputModule.Update()
    UIInputModule.Process()
    UIInputModule.SendUpdateEventToSelectedObject()
    UIInputModule.ActivateModule()
    UIInputModule.GetCurrentGameObject(int)
    UIInputModule.IsPointerOverGameObject(int)
    UIInputModule.finalizeRaycastResults
    UIInputModule.pointerEnter
    UIInputModule.pointerExit
    UIInputModule.pointerDown
    UIInputModule.pointerUp
    UIInputModule.pointerClick
    UIInputModule.pointerMove
    UIInputModule.initializePotentialDrag
    UIInputModule.beginDrag
    UIInputModule.drag
    UIInputModule.endDrag
    UIInputModule.drop
    UIInputModule.scroll
    UIInputModule.updateSelected
    UIInputModule.move
    UIInputModule.submit
    UIInputModule.cancel
    BaseInputModule.m_RaycastResultCache
    BaseInputModule.sendPointerHoverToParent
    BaseInputModule.m_InputOverride
    BaseInputModule.input
    BaseInputModule.inputOverride
    BaseInputModule.eventSystem
    BaseInputModule.FindFirstRaycast(List<RaycastResult>)
    BaseInputModule.DetermineMoveDirection(float, float)
    BaseInputModule.DetermineMoveDirection(float, float, float)
    BaseInputModule.FindCommonRoot(GameObject, GameObject)
    BaseInputModule.HandlePointerExitAndEnter(PointerEventData, GameObject)
    BaseInputModule.GetAxisEventData(float, float, float)
    BaseInputModule.GetBaseEventData()
    BaseInputModule.ShouldActivateModule()
    BaseInputModule.DeactivateModule()
    BaseInputModule.UpdateModule()
    BaseInputModule.IsModuleSupported()
    BaseInputModule.ConvertUIToolkitPointerId(PointerEventData)
    UIBehaviour.Start()
    UIBehaviour.IsActive()
    UIBehaviour.OnValidate()
    UIBehaviour.Reset()
    UIBehaviour.OnRectTransformDimensionsChange()
    UIBehaviour.OnBeforeTransformParentChanged()
    UIBehaviour.OnTransformParentChanged()
    UIBehaviour.OnDidApplyAnimationProperties()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.OnCanvasHierarchyChanged()
    UIBehaviour.IsDestroyed()
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit.UI
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [AddComponentMenu("Event/XR UI Input Module", 11)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.5/api/UnityEngine.XR.Interaction.Toolkit.UI.XRUIInputModule.html")]
    public class XRUIInputModule : UIInputModule

    Properties

    cancelAction

    The Input System action to use for cancelling or backing out of a UI element. Must be a ButtonControl Control.

    Declaration
    public InputActionReference cancelAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    cancelButton

    Name of the gamepad/joystick button to use for UI cancel or back commands when using the old Input Manager.

    Declaration
    public string cancelButton { get; set; }
    Property Value
    Type Description
    string

    enableBuiltinActionsAsFallback

    When enabled, built-in Input System actions will be used if no Input System UI Actions are assigned. This uses the currently enabled Input System devices: current, current, current, and current.

    Declaration
    public bool enableBuiltinActionsAsFallback { get; set; }
    Property Value
    Type Description
    bool

    enableGamepadInput

    If true, will forward gamepad data to UI elements. Ignored when any Input System UI Actions are used.

    Declaration
    public bool enableGamepadInput { get; set; }
    Property Value
    Type Description
    bool

    enableJoystickInput

    If true, will forward joystick data to UI elements. Ignored when any Input System UI Actions are used.

    Declaration
    public bool enableJoystickInput { get; set; }
    Property Value
    Type Description
    bool

    enableMouseInput

    If true, will forward 2D mouse data to UI elements. Ignored when any Input System UI Actions are used.

    Declaration
    public bool enableMouseInput { get; set; }
    Property Value
    Type Description
    bool

    enableTouchInput

    If true, will forward 2D touch data to UI elements. Ignored when any Input System UI Actions are used.

    Declaration
    public bool enableTouchInput { get; set; }
    Property Value
    Type Description
    bool

    enableXRInput

    If true, will forward 3D tracked device data to UI elements.

    Declaration
    public bool enableXRInput { get; set; }
    Property Value
    Type Description
    bool

    horizontalAxis

    Name of the horizontal axis for UI navigation when using the old Input Manager.

    Declaration
    public string horizontalAxis { get; set; }
    Property Value
    Type Description
    string

    leftClickAction

    The Input System action to use to determine whether the left button of a pointer is pressed. Must be a ButtonControl Control.

    Declaration
    public InputActionReference leftClickAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    middleClickAction

    The Input System action to use to determine whether the middle button of a pointer is pressed. Must be a ButtonControl Control.

    Declaration
    public InputActionReference middleClickAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    navigateAction

    The Input System action to use to navigate the currently active UI. Must be a Vector2Control Control.

    Declaration
    public InputActionReference navigateAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    pointAction

    The Input System action to use to move the pointer on the currently active UI. Must be a Vector2Control Control.

    Declaration
    public InputActionReference pointAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    rightClickAction

    The Input System action to use to determine whether the right button of a pointer is pressed. Must be a ButtonControl Control.

    Declaration
    public InputActionReference rightClickAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    scrollWheelAction

    The Input System action to use to move the pointer on the currently active UI. Must be a Vector2Control Control.

    Declaration
    public InputActionReference scrollWheelAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    submitAction

    The Input System action to use for submitting or activating a UI element. Must be a ButtonControl Control.

    Declaration
    public InputActionReference submitAction { get; set; }
    Property Value
    Type Description
    InputActionReference

    submitButton

    Name of the gamepad/joystick button to use for UI selection or submission when using the old Input Manager.

    Declaration
    public string submitButton { get; set; }
    Property Value
    Type Description
    string

    verticalAxis

    Name of the vertical axis for UI navigation when using the old Input Manager.

    Declaration
    public string verticalAxis { get; set; }
    Property Value
    Type Description
    string

    Methods

    Awake()

    See MonoBehavior.Awake.

    Declaration
    protected override void Awake()
    Overrides
    UnityEngine.EventSystems.UIBehaviour.Awake()

    DoProcess()

    Process the current tick for the module.

    Declaration
    protected override void DoProcess()
    Overrides
    UIInputModule.DoProcess()
    Remarks

    Executed once per Update call. Override for custom processing.

    See Also
    Process()

    GetInteractor(int)

    Gets an IUIInteractor from its corresponding Unity UI Pointer Id. This can be used to identify individual Interactors from the underlying UI Events.

    Declaration
    public IUIInteractor GetInteractor(int pointerId)
    Parameters
    Type Name Description
    int pointerId

    A unique integer representing an object that can point at UI.

    Returns
    Type Description
    IUIInteractor

    Returns the interactor associated with pointerId. Returns null if no Interactor is associated (e.g. if it's a mouse event).

    GetRegisteredInteractors(List<IUIInteractor>)

    Returns all registered Interactors into List results.

    Declaration
    public void GetRegisteredInteractors(List<IUIInteractor> results)
    Parameters
    Type Name Description
    List<IUIInteractor> results

    List to receive registered Interactors.

    Remarks

    This method populates the list with the registered Interactors at the time the method is called. It is not a live view, meaning Interactors registered or unregistered afterward will not be reflected in the results of this method. Clears results before adding to it.

    See Also
    RegisterInteractor(IUIInteractor)

    GetTrackedDeviceModel(IUIInteractor, out TrackedDeviceModel)

    Retrieves the UI Model for a selected IUIInteractor.

    Declaration
    public bool GetTrackedDeviceModel(IUIInteractor interactor, out TrackedDeviceModel model)
    Parameters
    Type Name Description
    IUIInteractor interactor

    The IUIInteractor you want the model for.

    TrackedDeviceModel model

    The returned model that reflects the UI state of the interactor.

    Returns
    Type Description
    bool

    Returns true if the model was retrieved. Otherwise, returns false.

    OnDestroy()

    See MonoBehavior.OnDestroy.

    Declaration
    protected override void OnDestroy()
    Overrides
    UnityEngine.EventSystems.UIBehaviour.OnDestroy()

    OnDisable()

    See MonoBehavior.OnDisable.

    Declaration
    protected override void OnDisable()
    Overrides
    UnityEngine.EventSystems.BaseInputModule.OnDisable()

    OnEnable()

    See MonoBehavior.OnEnable.

    Declaration
    protected override void OnEnable()
    Overrides
    UnityEngine.EventSystems.BaseInputModule.OnEnable()

    OnRegistered(UIInteractorRegisteredEventArgs)

    Automatically called when an IUIInteractor is registered with this component. Notifies the UI interactor, passing the given args.

    Declaration
    protected virtual void OnRegistered(UIInteractorRegisteredEventArgs args)
    Parameters
    Type Name Description
    UIInteractorRegisteredEventArgs args

    Event data containing the registered UI interactor.

    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    RegisterInteractor(IUIInteractor)

    OnUnregistered(UIInteractorUnregisteredEventArgs)

    Automatically called when an IUIInteractor is unregistered from this component. Notifies the UI interactor, passing the given args.

    Declaration
    protected virtual void OnUnregistered(UIInteractorUnregisteredEventArgs args)
    Parameters
    Type Name Description
    UIInteractorUnregisteredEventArgs args

    Event data containing the unregistered UI interactor.

    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    UnregisterInteractor(IUIInteractor)

    RegisterInteractor(IUIInteractor)

    Register an IUIInteractor with the UI system. Calling this will enable it to start interacting with UI.

    Declaration
    public void RegisterInteractor(IUIInteractor interactor)
    Parameters
    Type Name Description
    IUIInteractor interactor

    The IUIInteractor to use.

    RegisterWaitlistInteractors()

    Register all waitlist interactors, which were registered UI interactors to another XR UI Input Module when that other input module component was destroyed, or UI enabled interactors when project settings disallow automatic registration.

    Declaration
    public void RegisterWaitlistInteractors()

    RegisterWithWaitlist(IUIInteractor)

    Registers a new Interactor to a waitlist to be processed by the XR UI Input Module component once a default XR UI Input Module is available. This can be used to register the component argument to an XR UI Input Module when it does not have a reference to a particular XR UI Input Module.

    Declaration
    public static void RegisterWithWaitlist(IUIInteractor interactor)
    Parameters
    Type Name Description
    IUIInteractor interactor

    The Interactor to be registered to the waitlist.

    See Also
    UnregisterFromWaitList(IUIInteractor)
    RegisterInteractor(IUIInteractor)

    UnregisterFromWaitList(IUIInteractor)

    Remove the Interactor from the waitlist so that it will no longer be automatically registered with the default XR UI Input Module.

    Declaration
    public static void UnregisterFromWaitList(IUIInteractor interactor)
    Parameters
    Type Name Description
    IUIInteractor interactor

    The Interactor to be unregistered from the waitlist.

    See Also
    RegisterWithWaitlist(IUIInteractor)

    UnregisterInteractor(IUIInteractor)

    Unregisters an IUIInteractor with the UI system. This cancels all UI Interaction and makes the IUIInteractor no longer able to affect UI.

    Declaration
    public void UnregisterInteractor(IUIInteractor interactor)
    Parameters
    Type Name Description
    IUIInteractor interactor

    The IUIInteractor to stop using.

    Events

    interactorRegistered

    Calls the methods in its invocation list when an IUIInteractor is registered.

    Declaration
    public event Action<UIInteractorRegisteredEventArgs> interactorRegistered
    Event Type
    Type Description
    Action<UIInteractorRegisteredEventArgs>
    Remarks

    The UIInteractorRegisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.

    See Also
    RegisterInteractor(IUIInteractor)

    interactorUnregistered

    Calls the methods in its invocation list when an IUIInteractor is unregistered.

    Declaration
    public event Action<UIInteractorUnregisteredEventArgs> interactorUnregistered
    Event Type
    Type Description
    Action<UIInteractorUnregisteredEventArgs>
    Remarks

    The UIInteractorUnregisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.

    See Also
    UnregisterInteractor(IUIInteractor)
    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)