Added Linux controller mapping for the Xbox One Elite Series 2 controller in Bluetooth mode
authorSam Lantinga
Mon, 18 Nov 2019 14:08:05 -0800
changeset 132570a2ce5c4d86f
parent 13256 745f1355a80e
child 13258 9d38f48052c6
Added Linux controller mapping for the Xbox One Elite Series 2 controller in Bluetooth mode
src/core/linux/SDL_evdev.c
src/joystick/SDL_gamecontrollerdb.h
     1.1 --- a/src/core/linux/SDL_evdev.c	Mon Nov 18 11:51:39 2019 -0800
     1.2 +++ b/src/core/linux/SDL_evdev.c	Mon Nov 18 14:08:05 2019 -0800
     1.3 @@ -446,18 +446,19 @@
     1.4  {
     1.5      SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
     1.6  
     1.7 -    if (keycode < SDL_arraysize(linux_scancode_table))
     1.8 +    if (keycode < SDL_arraysize(linux_scancode_table)) {
     1.9          scancode = linux_scancode_table[keycode];
    1.10  
    1.11 -    if (scancode == SDL_SCANCODE_UNKNOWN) {
    1.12 -        /* BTN_TOUCH is handled elsewhere, but we might still end up here if
    1.13 -           you get an unexpected BTN_TOUCH from something SDL believes is not
    1.14 -           a touch device. In this case, we'd rather not get a misleading
    1.15 -           SDL_Log message about an unknown key. */
    1.16 -        if (keycode != BTN_TOUCH) {
    1.17 -            SDL_Log("The key you just pressed is not recognized by SDL. To help "
    1.18 -                "get this fixed, please report this to the SDL forums/mailing list "
    1.19 -                "<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
    1.20 +        if (scancode == SDL_SCANCODE_UNKNOWN) {
    1.21 +            /* BTN_TOUCH is handled elsewhere, but we might still end up here if
    1.22 +               you get an unexpected BTN_TOUCH from something SDL believes is not
    1.23 +               a touch device. In this case, we'd rather not get a misleading
    1.24 +               SDL_Log message about an unknown key. */
    1.25 +            if (keycode != BTN_TOUCH) {
    1.26 +                SDL_Log("The key you just pressed is not recognized by SDL. To help "
    1.27 +                    "get this fixed, please report this to the SDL forums/mailing list "
    1.28 +                    "<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
    1.29 +            }
    1.30          }
    1.31      }
    1.32  
     2.1 --- a/src/joystick/SDL_gamecontrollerdb.h	Mon Nov 18 11:51:39 2019 -0800
     2.2 +++ b/src/joystick/SDL_gamecontrollerdb.h	Mon Nov 18 14:08:05 2019 -0800
     2.3 @@ -563,6 +563,7 @@
     2.4      "0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,",
     2.5      "030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
     2.6      "0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
     2.7 +    "050000005e040000050b000003090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b137,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
     2.8      "030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
     2.9      "050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
    2.10      "050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",