fix(input): Back gesture opens the menu when a controller exposes its own mouse (#2666)

The 8BitDo Ultimate Mobile registers a mouse interface next to its gamepad.
On REDMAGIC the back gesture has no virtual-hard-key flag, so with that
mouse attached it was sent to the game as a right-click. A mouse that
shares its USB id with an attached controller no longer counts.
This commit is contained in:
Shawn Montgomery authored and GitHub committed 2026-11-15 09:35:31 -05:00
1 parent c2663ebee8
commit 9c349e185e
3 files changed
+24 -2

No files matched your search

@@ -4786,8 +4786,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
private fun externalMouseAttached(): Boolean {
lastExternalMouse = InputDevice.getDeviceIds().map { InputDevice.getDevice(it) }
.firstOrNull { device -> device != null && com.droiddeck.launcher.input.MouseBackInput.isExternalMouse(device) }
lastExternalMouse = com.droiddeck.launcher.input.MouseBackInput.externalMouse(
InputDevice.getDeviceIds().map { InputDevice.getDevice(it) })
return lastExternalMouse != null
}