From db320e460aba368ff046949413456a8ebdd90e89 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 4 Dec 2018 14:21:29 -0800 Subject: [PATCH] Fixed the PS4 motion controls showing up as a separate game controller on Linux --- Android.mk | 0 src/joystick/SDL_gamecontroller.c | 7 +++++++ 2 files changed, 7 insertions(+) mode change 100644 => 100755 Android.mk diff --git a/Android.mk b/Android.mk old mode 100644 new mode 100755 diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 65645f187d762..ae549425acb7e 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1466,6 +1466,13 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) Uint16 version; Uint32 vidpid; +#if defined(__LINUX__) + if (name && SDL_strcmp(name, "Sony Interactive Entertainment Wireless Controller Motion Sensors") == 0) { + /* Don't treat the PS4 motion controls as a separate game controller */ + return SDL_TRUE; + } +#endif + if (SDL_allowed_controllers.num_entries == 0 && SDL_ignored_controllers.num_entries == 0) { return SDL_FALSE;