docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Introduction to Virtual Mouse for UI cursor control

    If your application uses gamepads and joysticks as an input, you can use navigation input actions to operate the UI. However, it usually involves extra work to make the UI work well with navigation.

    An alternative way to operate the UI is to allow gamepads and joysticks to drive the cursor from a virtual mouse. The Input System package provides a Virtual Mouse component for this purpose.

    At runtime, the component adds a virtual Mouse device which the InputSystemUIInputModule component picks up. The controls of the Mouse are fed input based on the actions configured on the VirtualMouseInput component.

    Note that the resulting Mouse input is visible in all code that picks up input from the mouse device. You can therefore use the component for mouse simulation elsewhere, not just with InputSystemUIInputModule.

    To see an example of the Virtual Mouse in a project, see the Gamepad Mouse Cursor sample included with the Input System package.

    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)