From 799cb07d425bc1834a727e8abf0cf508af3c73f0 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Mon, 30 Oct 2023 00:29:37 -0400 Subject: [PATCH] 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. --- .../org/yuzu/yuzu_emu/utils/InputHandler.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt index e963dfbc17..7ed1ae4252 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt @@ -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 } }