Commit 69b2baec5c434d6940bb2a5ba3f9e3e0db72e365

Sam Lantinga 2023-02-14T18:02:12

Map the Android MENU button back to the SDL MENU key Thanks to @AntTheAlchemist for the investigation! Fixes https://github.com/libsdl-org/SDL/issues/7318 (cherry picked from commit beb6a2afdc74a00f07ec230297c2675920a7bf79)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c
index 8457d1e..612cc04 100644
--- a/src/joystick/android/SDL_sysjoystick.c
+++ b/src/joystick/android/SDL_sysjoystick.c
@@ -185,6 +185,8 @@ static SDL_Scancode button_to_scancode(int button)
         return SDL_SCANCODE_ESCAPE;
     case SDL_CONTROLLER_BUTTON_BACK:
         return SDL_SCANCODE_ESCAPE;
+    case SDL_CONTROLLER_BUTTON_START:
+        return SDL_SCANCODE_MENU;
     case SDL_CONTROLLER_BUTTON_DPAD_UP:
         return SDL_SCANCODE_UP;
     case SDL_CONTROLLER_BUTTON_DPAD_DOWN: