From 6f6382f8d06f777edd77f95b5f91a1c583c13e8d Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Fri, 15 May 2020 20:45:30 +0200 Subject: [PATCH] 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) --- src/joystick/SDL_gamecontrollerdb.h | 3 +++ src/video/psp/SDL_pspvideo.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h index e4ba3fa8b4..900f549d8d 100644 --- a/src/joystick/SDL_gamecontrollerdb.h +++ b/src/joystick/SDL_gamecontrollerdb.h @@ -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 diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index 67f59af5f1..8dca5b92b5 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -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;