You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ however, it has to be formatted properly to pass verification tests.
16
16
17
17
### Fixed
18
18
- An issue where a UITK MouseEvent was triggered when changing from Scene View to Game View in the Editor has been fixed. [ISXB-1671](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1671)
19
+
- Fix documentation error in file AndroidGameController.cs mentioning a wrong controller. [DOCATT-9806]
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/InputSystem/Plugins/Android/AndroidGameController.cs
+45-37Lines changed: 45 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -140,47 +140,55 @@ public override string ToString()
140
140
141
141
namespaceUnityEngine.InputSystem.Android
142
142
{
143
-
////FIXME: This is messy! Clean up!
144
143
/// <summary>
145
-
/// Gamepad on Android. Comprises all types of gamepads supported on Android.
144
+
/// Represents a gamepad device on Android, providing unified support for various controller types.
146
145
/// </summary>
147
146
/// <remarks>
148
-
/// Most of the gamepads:
147
+
/// This layout covers multiple Android-supported gamepads, including but not limited to:
149
148
/// - ELAN PLAYSTATION(R)3 Controller
150
-
/// - My-Power CO.,LTD. PS(R) Controller Adaptor
151
-
/// (Following tested and work with: Nvidia Shield TV (OS 9); Galaxy Note 20 Ultra (OS 11); Galaxy S9+ (OS 10.0))
152
-
/// - Sony Interactive Entertainment Wireless (PS4 DualShock) (Also tested and DOES NOT WORK with Galaxy S9 (OS 8.0); Galaxy S8 (OS 7.0); Xiaomi Mi Note2 (OS 8.0))
153
-
/// - Xbox Wireless Controller (Xbox One) (Also tested and works on Samsung Galaxy S8 (OS 7.0); Xiaomi Mi Note2 (OS 8.0))
149
+
/// - My-Power CO., LTD. PS(R) Controller Adaptor
150
+
/// - Sony Interactive Entertainment Wireless (PS4 DualShock)
151
+
/// - Xbox Wireless Controller (Xbox One)
154
152
/// - NVIDIA Controller v01.03/v01.04
155
-
/// - (Add more)
156
-
/// map buttons in the following way:
157
-
/// Left Stick -> AXIS_X(0) / AXIS_Y(1)
158
-
/// Right Stick -> AXIS_Z (11) / AXIS_RZ(14)
159
-
/// Right Thumb -> KEYCODE_BUTTON_THUMBR(107)
160
-
/// Left Thumb -> KEYCODE_BUTTON_THUMBL(106)
161
-
/// L1 (Left shoulder) -> KEYCODE_BUTTON_L1(102)
162
-
/// R1 (Right shoulder) -> KEYCODE_BUTTON_R1(103)
163
-
/// L2 (Left trigger) -> AXIS_BRAKE(23)
164
-
/// R2 (Right trigger) -> AXIS_GAS(22)
165
-
/// X -> KEYCODE_BUTTON_X(99)
166
-
/// Y -> KEYCODE_BUTTON_Y(100)
167
-
/// B -> KEYCODE_BUTTON_B(97)
168
-
/// A -> KEYCODE_BUTTON_A(96)
169
-
/// DPAD -> AXIS_HAT_X(15),AXIS_HAT_Y(16) or KEYCODE_DPAD_LEFT(21), KEYCODE_DPAD_RIGHT(22), KEYCODE_DPAD_UP(19), KEYCODE_DPAD_DOWN(20),
170
-
/// Note: On Nvidia Shield Console, L2/R2 additionally invoke key events for AXIS_LTRIGGER, AXIS_RTRIGGER (in addition to AXIS_BRAKE, AXIS_GAS)
171
-
/// If you connect gamepad to a phone for L2/R2 only AXIS_BRAKE/AXIS_GAS come. AXIS_LTRIGGER, AXIS_RTRIGGER are not invoked.
172
-
/// That's why we map triggers only to AXIS_BRAKE/AXIS_GAS
173
-
/// Nvidia Shield also reports KEYCODE_BACK instead of KEYCODE_BUTTON_SELECT, so Options(XboxOne Controller)/View(DualShock)/Select buttons do not work
174
-
/// PS4 controller is officially supported from Android 10 and higher (https://playstation.com/en-us/support/hardware/ps4-pair-dualshock-4-wireless-with-sony-xperia-and-android)
175
-
/// However, some devices with older OS have fixed PS4 controller support on their drivers this leads to following situation:
176
-
/// Some gamepads on Android devices (with same Android number version) might have different mappings
177
-
/// For ex., Dualshock, on NVidia Shield Console (OS 8.0) all buttons correctly map according to rules in AndroidGameControllerState
178
-
/// when clicking left shoulder it will go to AndroidKeyCode.ButtonL1, rightShoulder -> AndroidKeyCode.ButtonR1, etc
179
-
/// But, on Samsung Galaxy S9 (OS 8.0), the mapping is different (Same for Xiaomi Mi Note2 (OS 8.0), Samsung Galaxy S8 (OS 7.0))
180
-
/// when clicking left shoulder it will go to AndroidKeyCode.ButtonY, rightShoulder -> AndroidKeyCode.ButtonZ, etc
181
-
/// So even though Android version is 8.0 in both cases, Dualshock will only correctly work on NVidia Shield Console
182
-
/// It's obvious that this depends on the driver and not Android OS, thus we can only assume Samsung in this case doesn't properly support Dualshock in their drivers
183
-
/// While we can do custom mapping for Samsung, we can never now when will they try to update the driver for Dualshock or some other gamepad
/// | DPAD | AXIS_HAT_X(15), AXIS_HAT_Y(16) or KEYCODE_DPAD_* |
171
+
///
172
+
/// ### Notes
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 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**
/// - 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` (for example, `L1 → ButtonL1`, `R1 → ButtonR1`).
188
+
/// - **Samsung Galaxy S9 / S8** and **Xiaomi Mi Note2:** mappings are inconsistent (for example, `L1 → ButtonY`, `R1 → ButtonZ`).
189
+
/// - These discrepancies stem from device-specific **driver differences**, not the Android OS itself.
190
+
///
191
+
/// Because mapping inconsistencies depend on vendor-specific drivers, it’s impractical to maintain per-device remaps.
0 commit comments