AndroidInputEmulationMode
Options that specify whether the target device, Unity, or neither converts mouse and touchpad input into touch input in the Android application.
Read time 1 minuteLast updated 3 days ago
Definition
- Type: Enum
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public enum AndroidInputEmulationMode
Remarks
Use these values with PlayerSettings.Android.inputEmulation.
Input emulation converts the following input into touch input:
- Mouse presses that start with the left mouse button
- Touchpad clicks and drags
- Two-finger touchpad scrolls, on Android 14 and later
With AndroidInputEmulationMode.Engine, the right and middle mouse buttons, the scroll wheel, and the pointer position when no button is pressed remain mouse input.
The following code example demonstrates AndroidInputEmulationMode.None, which makes the application receive mouse and touchpad input unchanged on every Android device.
Examples
using UnityEngine;using UnityEditor;public class InputEmulationModeSample : MonoBehaviour{ [MenuItem("Build/Receive Mouse Input Unchanged")] public static void ReceiveMouseInputUnchanged() { // Disable input emulation so that neither the device nor Unity converts mouse and touchpad input into touch input. PlayerSettings.Android.inputEmulation = AndroidInputEmulationMode.None; }}