Skip to content

Commit 25bd4b1

Browse files
Enhance documentation for Android game controller support
1 parent bb4a8ff commit 25bd4b1

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/Android/AndroidGameController.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,23 @@ namespace UnityEngine.InputSystem.Android
170170
/// | DPAD | AXIS_HAT_X(15), AXIS_HAT_Y(16) or KEYCODE_DPAD_* |
171171
///
172172
/// ### Notes
173-
/// - On **NVIDIA Shield**, L2/R2 may also trigger `AXIS_LTRIGGER` / `AXIS_RTRIGGER` in addition to `AXIS_BRAKE` / `AXIS_GAS`.
174-
/// On phones, only the brake/gas axes are triggered.
175-
/// - NVIDIA Shield reports `KEYCODE_BACK` instead of `KEYCODE_BUTTON_SELECT`, so the Options/View/Select buttons won’t work.
176-
/// - PS4 controllers are officially supported on Android 10+, but some OEMs (e.g., Samsung, Xiaomi) have broken mappings on older OS versions.
177-
/// - Even on the same Android version, mappings may differ depending on the device’s driver.
178-
/// For example, on Android 8.0:
179-
/// - **NVIDIA Shield Console**: correct DualShock mapping
180-
/// - **Samsung Galaxy S9 / S8 / Xiaomi Mi Note2**: remapped buttons (e.g., L1 → Y, R1 → Z)
173+
/// - **NVIDIA Shield Console**
174+
/// - The L2 and R2 triggers generate both `AXIS_BRAKE` / `AXIS_GAS` and `AXIS_LTRIGGER` / `AXIS_RTRIGGER` events.
175+
/// - On most Android phones, only `AXIS_BRAKE` and `AXIS_GAS` are reported; `AXIS_LTRIGGER` and `AXIS_RTRIGGER` are not invoked.
176+
/// - For consistency across devices, triggers are therefore mapped exclusively to `AXIS_BRAKE` and `AXIS_GAS`.
177+
/// - The Shield also reports `KEYCODE_BACK` instead of `KEYCODE_BUTTON_SELECT`, causing the **Options** (Xbox), **View** (DualShock), or **Select** buttons to be non-functional.
178+
///
179+
/// - **PS4 Controller Compatibility**
180+
/// - Official PS4 controller support is available starting from **Android 10 and later**
181+
/// (see: https://playstation.com/en-us/support/hardware/ps4-pair-dualshock-4-wireless-with-sony-xperia-and-android).
182+
/// - On older Android versions, driver implementations vary by manufacturer. Some vendors have partially fixed DualShock support in custom drivers, leading to inconsistent mappings.
183+
///
184+
/// - **Driver-Dependent Behavior**
185+
/// - Gamepad mappings may differ even between devices running the *same Android version*.
186+
/// - For example, on **Android 8.0**:
187+
/// - **NVIDIA Shield Console:** buttons map correctly according to `AndroidGameControllerState` (e.g., `L1 → ButtonL1`, `R1 → ButtonR1`).
188+
/// - **Samsung Galaxy S9 / S8** and **Xiaomi Mi Note2:** mappings are inconsistent (e.g., `L1 → ButtonY`, `R1 → ButtonZ`).
189+
/// - These discrepancies stem from device-specific **driver differences**, not the Android OS itself.
181190
///
182191
/// Because mapping inconsistencies depend on vendor-specific drivers, it’s impractical to maintain per-device remaps.
183192
/// </remarks>

0 commit comments

Comments
 (0)