Documentation

Unity Engine

Download Unity

Unity Engine

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

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; }}

Fields

Value

Description

EngineUnity converts mouse and touchpad input into touch input on every Android device.
NoneNeither the device nor Unity converts mouse and touchpad input into touch input.
PlatformThe device determines whether to convert mouse and touchpad input into touch input.