From cab1a715f52eef086157f675339e943f971d7e64 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 15 Jul 2020 10:15:52 -0700 Subject: [PATCH] Fixed bug 5233 - PS3 Gamepad Motion Control not correctly ignored on Linux Igor Morgado PS3 Controller motion sensor string is being reported as `Gasia Co.,Ltd PS(R) Gamepad Motion Sensors` But `src/joystick/SDL_gamecontroller.c` line1690 only ignores if matches the string `Controller Motion Sensors`. ``` #if defined(__LINUX__) if (name && SDL_strstr(name, "Controller Motion Sensors")) { /* Don't treat the PS3 and PS4 motion controls as a separate game controller */ return SDL_TRUE; } #endif ``` Therefore, SDL is mapping 2 Game controllers instead one. Maybe reduce the substring to match `Motion Sensors` instead. A simple log from my application is shown below: INFO: Game controller device 0 - PS3 Controller:PS3 Controller found. INFO: Controller 0: Player 0: 054c:0268:8111 - PS3 Controller - PS3 Controller - Gasia Co.,Ltd PS(R) Gamepad INFO: Game controller device 1 - PS3 Controller:PS3 Controller found. INFO: Controller 1: Player 1: 054c:0268:8111 - PS3 Controller - PS3 Controller - Gasia Co.,Ltd PS(R) Gamepad Motion Sensors --- src/joystick/SDL_gamecontroller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 80a6d0397..534122db4 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1687,7 +1687,7 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) Uint32 vidpid; #if defined(__LINUX__) - if (name && SDL_strstr(name, "Controller Motion Sensors")) { + if (name && SDL_strstr(name, "Motion Sensors")) { /* Don't treat the PS3 and PS4 motion controls as a separate game controller */ return SDL_TRUE; }