From 04b710232ea16ec1ccf4f9a40b66bedf535ccef1 Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Wed, 26 Jun 2024 22:38:45 -0700 Subject: Android: Prevent duplicate mapping of surjective keys --- xbmc/platform/android/peripherals/AndroidJoystickState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/platform/android/peripherals/AndroidJoystickState.cpp b/xbmc/platform/android/peripherals/AndroidJoystickState.cpp index 9e622d4d73..3b1099dd3b 100644 --- a/xbmc/platform/android/peripherals/AndroidJoystickState.cpp +++ b/xbmc/platform/android/peripherals/AndroidJoystickState.cpp @@ -469,6 +469,10 @@ bool CAndroidJoystickState::MapButton(JOYSTICK::IButtonMap& buttonMap, int butto if (controllerButton.empty()) return false; + // Check if feature is already mapped + if (buttonMap.GetFeatureType(controllerButton) != JOYSTICK::FEATURE_TYPE::UNKNOWN) + return false; + // Map the button CLog::Log(LOGDEBUG, "Automatically mapping {} to {}", controllerButton, buttonPrimitive.ToString()); -- cgit v1.2.3