docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Pointer input UI support

    A pointer is a position from which clicks and scrolls can trigger to interact with UI elements at the pointer's position. Pointer-type input comes from the following actions:

    • point
    • leftClick
    • rightClick
    • middleClick
    • scrollWheel

    The UI input model doesn't associate pointers and cursors together. However, it pins the pointer for both mouse and pen input at 1,1 depending on the state of Cursor.lockState. The cursor lock behavior is defined by the Cursor Lock Behavior property of the UI Input Module.

    Multiple pointer devices

    Multiple pointer devices can feed input into a single UI Input Module. Touchscreen devices can have multiple concurrent pointers (each finger contact is one pointer) on a single device.

    Because multiple pointer devices can feed into the same set of actions, it's important to set the action type to PassThrough. This ensures that no filtering is applied to input on these actions and that instead every input is relayed as is.

    From the perspective of InputSystemUIInputModule, each InputDevice that has one or more controls bound to one of the pointer-type actions is a unique pointer. Also, for each Touchscreen devices, each separate TouchControl that has one or more of its controls bound to the those actions is its own unique pointer as well. Each pointer receives a unique pointerId which generally corresponds to the deviceId of the pointer. However, for touch, this will be a combination of deviceId and touchId. Use ExtendedPointerEventData.touchId to find the ID for a touch event.

    If you bind a device to a pointer-type action such as Left Click without also binding it to Point, the UI Input Module recognizes the device as not able to point, and attempts to route its input into another pointer. For example, if you bind Left Click to the Space key and Point to the position of the mouse, then pressing the space bar results in a left-click at the current position of the mouse.

    For pointer-type input (and tracked-type input), InputSystemUIInputModule sends ExtendedPointerEventData instances, which are an extended version of the base PointerEventData. These events contain additional data such as the device and pointer type that the Input System has used to generate the event.

    Pointer behavior for multiple devices

    The UI Module's Pointer Behavior property defines how to deal with concurrent input from multiple pointers.

    Unify mouse and pen input but separate touch and track input

    Single Mouse or Pen But Multi Touch And Track behaves like Single Unified Pointer for all input that is not classified as touch or tracked input, and behaves like All Pointers As Is for tracked and touch input.

    If concurrent input is received on a Mouse and Pen, for example, the input of both is fed into the same UI pointer instance. The position input of one will overwrite the position of the other.

    When input is received from touch or tracked devices, the single unified pointer for mice and pens is removed, including IPointerExit events being sent in case the mouse/pen cursor is currently hovering over objects. This is the default behavior.

    Unify all pointer inputs

    Single Unified Pointer unifies all pointer input so that there is only ever a single pointer. This includes touch and tracked input. This means, for example, that regardless of how many devices feed input into Point, only the last input in a frame takes effect and becomes the current UI pointer's position.

    Treat all pointers as separate

    All Pointers As Is treats each input as separate and individual. Any device, including touch and tracked devices that feed input pointer-type actions, is its own pointer (or multiple pointers for touch input). This might mean that there are multiple pointers in the UI, and several objects might be pointed at at the same time.

    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)