Fix SDL_GameController API for PSP (#3)

- Add missing mapping
- Make sure the only window has the keyboard focus (so no `SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS` is needed)
This commit is contained in:
Sergio Padrino 2020-05-15 20:45:30 +02:00 committed by Sam Lantinga
parent da0f76de6d
commit 6f6382f8d0
2 changed files with 4 additions and 0 deletions

View file

@ -895,6 +895,9 @@ static const char *s_ControllerMappings [] =
#endif
#if defined(SDL_JOYSTICK_VITA)
"50535669746120436f6e74726f6c6c65,PSVita Controller,a:b2,b:b1,back:b10,dpdown:b6,dpleft:b7,dpright:b9,dpup:b8,leftshoulder:b4,leftstick:b14,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,",
#endif
#if defined(SDL_JOYSTICK_PSP)
"505350206275696c74696e206a6f7970,PSP builtin joypad,y:b0,b:b1,a:b2,x:b3,leftshoulder:b4,rightshoulder:b5,dpdown:b6,dpleft:b7,dpup:b8,dpright:b9,back:b10,start:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,",
#endif
"hidapi,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
NULL

View file

@ -214,6 +214,7 @@ PSP_CreateWindow(_THIS, SDL_Window * window)
/* Setup driver data for this window */
window->driverdata = wdata;
SDL_SetKeyboardFocus(window);
/* Window has been successfully created */
return 0;