diff options
author | Garrett Brown <themagnificentmrb@gmail.com> | 2024-01-30 16:51:13 -0800 |
---|---|---|
committer | Garrett Brown <themagnificentmrb@gmail.com> | 2024-02-02 08:44:55 -0800 |
commit | 88acd72d8a7b692fafbb41bbc8616171219fb4ce (patch) | |
tree | 5d558602ff8715c61ffdf7281331024585ecef8f | |
parent | 55f207cc219e9cdac9420a837c05fa1ee97c1aed (diff) |
[Android][Peripherals] Fix input for non-button keycodes
-rw-r--r-- | xbmc/platform/android/peripherals/AndroidJoystickState.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xbmc/platform/android/peripherals/AndroidJoystickState.cpp b/xbmc/platform/android/peripherals/AndroidJoystickState.cpp index c85abd7a65..90409e65c0 100644 --- a/xbmc/platform/android/peripherals/AndroidJoystickState.cpp +++ b/xbmc/platform/android/peripherals/AndroidJoystickState.cpp @@ -271,6 +271,25 @@ bool CAndroidJoystickState::ProcessEvent(const AInputEvent* event) bool result = SetButtonValue(keycode, buttonState); + if (!result) + { + // Try shoehorning keys into buttons + switch (keycode) + { + case AKEYCODE_MENU: + result = SetButtonValue(AKEYCODE_BUTTON_START, buttonState); + break; + case AKEYCODE_BACK: + result = SetButtonValue(AKEYCODE_BUTTON_SELECT, buttonState); + break; + case AKEYCODE_HOME: + result = SetButtonValue(AKEYCODE_BUTTON_MODE, buttonState); + break; + default: + break; + } + } + return result; } |