Handle menu button press from controller

This commit is contained in:
Temdog007 2022-02-02 19:21:34 -07:00 committed by Sam Lantinga
parent 2005dd9595
commit b59e75c259
2 changed files with 3 additions and 0 deletions

View File

@ -319,6 +319,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
KeyEvent.KEYCODE_BUTTON_X, KeyEvent.KEYCODE_BUTTON_X,
KeyEvent.KEYCODE_BUTTON_Y, KeyEvent.KEYCODE_BUTTON_Y,
KeyEvent.KEYCODE_BACK, KeyEvent.KEYCODE_BACK,
KeyEvent.KEYCODE_MENU,
KeyEvent.KEYCODE_BUTTON_MODE, KeyEvent.KEYCODE_BUTTON_MODE,
KeyEvent.KEYCODE_BUTTON_START, KeyEvent.KEYCODE_BUTTON_START,
KeyEvent.KEYCODE_BUTTON_THUMBL, KeyEvent.KEYCODE_BUTTON_THUMBL,
@ -360,6 +361,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
(1 << 2), // X -> X (1 << 2), // X -> X
(1 << 3), // Y -> Y (1 << 3), // Y -> Y
(1 << 4), // BACK -> BACK (1 << 4), // BACK -> BACK
(1 << 6), // MENU -> START
(1 << 5), // MODE -> GUIDE (1 << 5), // MODE -> GUIDE
(1 << 6), // START -> START (1 << 6), // START -> START
(1 << 7), // THUMBL -> LEFTSTICK (1 << 7), // THUMBL -> LEFTSTICK

View File

@ -103,6 +103,7 @@ keycode_to_SDL(int keycode)
case AKEYCODE_BUTTON_THUMBR: case AKEYCODE_BUTTON_THUMBR:
button = SDL_CONTROLLER_BUTTON_RIGHTSTICK; button = SDL_CONTROLLER_BUTTON_RIGHTSTICK;
break; break;
case AKEYCODE_MENU:
case AKEYCODE_BUTTON_START: case AKEYCODE_BUTTON_START:
button = SDL_CONTROLLER_BUTTON_START; button = SDL_CONTROLLER_BUTTON_START;
break; break;