android: InputHandler: Only handle inputs for player 1

Since we don't have controller remapping on android at the moment, we shouldn't be trying to handle each controller slot automatically like this. In some cases android can pick up input devices that a user doesn't want to control yuzu with and we end up forwarding their actual controller inputs to a disconnected controller. This will stay hardcoded to the player 1 devices until we can get remapping in order.
This commit is contained in:
Charles Lombardo 2023-10-30 00:29:37 -04:00
parent eec3d356b6
commit 799cb07d42

View file

@ -60,19 +60,11 @@ class InputHandler {
private fun getPlayerNumber(index: Int): Int {
// TODO: Joycons are handled as different controllers. Find a way to merge them.
return when (index) {
2 -> NativeLibrary.Player2Device
3 -> NativeLibrary.Player3Device
4 -> NativeLibrary.Player4Device
5 -> NativeLibrary.Player5Device
6 -> NativeLibrary.Player6Device
7 -> NativeLibrary.Player7Device
8 -> NativeLibrary.Player8Device
else -> if (NativeLibrary.isHandheldOnly()) {
NativeLibrary.ConsoleDevice
} else {
NativeLibrary.Player1Device
}
// Since we don't have controller remapping currently, only choose from one of the primary controllers
return if (NativeLibrary.isHandheldOnly()) {
NativeLibrary.ConsoleDevice
} else {
NativeLibrary.Player1Device
}
}