Fixed the PS4 motion controls showing up as a separate game controller on Linux
authorSam Lantinga <slouken@libsdl.org>
Tue, 04 Dec 2018 14:21:29 -0800
changeset 1245313e20aa44346
parent 12452 983247abc7e5
child 12454 762a775a58cd
Fixed the PS4 motion controls showing up as a separate game controller on Linux
Android.mk
src/joystick/SDL_gamecontroller.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Tue Dec 04 18:15:45 2018 +0100
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Tue Dec 04 14:21:29 2018 -0800
     1.3 @@ -1466,6 +1466,13 @@
     1.4      Uint16 version;
     1.5      Uint32 vidpid;
     1.6  
     1.7 +#if defined(__LINUX__)
     1.8 +    if (name && SDL_strcmp(name, "Sony Interactive Entertainment Wireless Controller Motion Sensors") == 0) {
     1.9 +        /* Don't treat the PS4 motion controls as a separate game controller */
    1.10 +        return SDL_TRUE;
    1.11 +    }
    1.12 +#endif
    1.13 +
    1.14      if (SDL_allowed_controllers.num_entries == 0 &&
    1.15          SDL_ignored_controllers.num_entries == 0) {
    1.16          return SDL_FALSE;