Input for Android devices
Understand how to detect and handle user input on different types of Android devices.
Read time 1 minuteLast updated 9 days ago
Mobile devices are the primary target for Android applications. Unity provides an Input System package to handle user input on Android devices. This input solution is enabled by default for new projects.
The Input System package supports a variety of input devices on the Android platform, including mouse, keyboard, pen, touchscreen, sensors, joystick, and gamepads. For more information, refer to Supported input devices in the Input System package documentation.
For additional input features on Android, refer to the following sections:
On-screen keyboard support
Android devices automatically display an on-screen touchscreen keyboard when users select editable UI elements, such as Input Fields created using UGUI, or TextField controls created using UI Toolkit, or IMGUI. Unity automatically activates the Android keyboard and handles input from it. If you want to manually activate and configure the Android touchscreen keyboard behavior, refer to Mobile Keyboard.
Gamepad support
Unity provides gamepad support allowing users to use physical controllers when playing your Android games. You can configure the level of gamepad support in the Android Player settings > Other Settings > Configuration > Android Gamepad Support Level. To handle gamepad input, use the Input System package APIs.