Skip to content

Commit

Permalink
Fix SDL_GameController API for PSP (#3)
Browse files Browse the repository at this point in the history
- Add missing mapping
- Make sure the only window has the keyboard focus (so no `SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS` is needed)
  • Loading branch information
sergiou87 authored and slouken committed Dec 7, 2021
1 parent da0f76d commit 6f6382f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/joystick/SDL_gamecontrollerdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/video/psp/SDL_pspvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f6382f

Please sign in to comment.