docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Mouse devices introduction

    The Input System represents mouse input with the MouseState device layout that the Mouse class implements.

    Important

    The Input System doesn't support input from multiple mice at the platform level, or identifying the current display a mouse is on.

    The Mouse class is based on the pointer layout so inherits its controls. It also implements additional controls outlined in the Mouse API documentation.

    Mice on mobile platforms

    On mobile platforms, a mouse isn't usually connected, so don't assume that a Mouse device exists:

    • On iOS and tvOS, the Input System doesn't detect mice. It doesn't add a Mouse device when the user connects a mouse, so Mouse.current is null unless your application adds a virtual mouse, for example with the Virtual Mouse component.
    • On Android, the Input System adds a Mouse device only when the user connects a mouse or a trackpad. Until then, Mouse.current is null.
    • Touch input doesn't create or move a Mouse device. The Input System reports touch input through the Touchscreen device.

    To check whether the platform supports mice, use Mouse.isSupported. To check whether a Mouse device is available, check that Mouse.current isn't null. This includes virtual mice that your application adds, so it doesn't always mean that a physical mouse is connected. To read input from the pointer that the user used last, including touch, use Pointer.current.

    For a list of platforms that support mice, refer to Supported devices reference.

    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)