Added support for the SteelSeries Stratus Duo
authorSam Lantinga <slouken@libsdl.org>
Mon, 16 Dec 2019 17:11:23 -0800
changeset 13350a9ce6aa098b6
parent 13349 7324ce6b653b
child 13351 472db3f71645
Added support for the SteelSeries Stratus Duo
src/hidapi/SDL_hidapi.c
src/hidapi/libusb/hid.c
src/joystick/SDL_gamecontrollerdb.h
src/joystick/SDL_joystick.c
src/joystick/controller_type.h
src/joystick/hidapi/SDL_hidapi_xbox360.c
     1.1 --- a/src/hidapi/SDL_hidapi.c	Mon Dec 16 10:26:36 2019 -0800
     1.2 +++ b/src/hidapi/SDL_hidapi.c	Mon Dec 16 17:11:23 2019 -0800
     1.3 @@ -556,8 +556,8 @@
     1.4  #if HAVE_PLATFORM_BACKEND
     1.5              for (raw_dev = raw_devs; raw_dev; raw_dev = raw_dev->next) {
     1.6                  if (usb_dev->vendor_id == raw_dev->vendor_id &&
     1.7 -                    usb_dev->product_id == raw_dev->product_id) {
     1.8 -
     1.9 +                    usb_dev->product_id == raw_dev->product_id &&
    1.10 +                    usb_dev->interface_number == raw_dev->interface_number) {
    1.11                      bFound = SDL_TRUE;
    1.12                      break;
    1.13                  }
     2.1 --- a/src/hidapi/libusb/hid.c	Mon Dec 16 10:26:36 2019 -0800
     2.2 +++ b/src/hidapi/libusb/hid.c	Mon Dec 16 17:11:23 2019 -0800
     2.3 @@ -493,6 +493,7 @@
     2.4  		0x07ff, /* Mad Catz */
     2.5  		0x0e6f, /* PDP */
     2.6  		0x0f0d, /* Hori */
     2.7 +		0x1038, /* SteelSeries */
     2.8  		0x11c9, /* Nacon */
     2.9  		0x12ab, /* Unknown */
    2.10  		0x1430, /* RedOctane */
     3.1 --- a/src/joystick/SDL_gamecontrollerdb.h	Mon Dec 16 10:26:36 2019 -0800
     3.2 +++ b/src/joystick/SDL_gamecontrollerdb.h	Mon Dec 16 17:11:23 2019 -0800
     3.3 @@ -249,6 +249,7 @@
     3.4      "030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
     3.5      "03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
     3.6      "03000000d11800000094000000000000,Stadia Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b11,rightx:a3,righty:a4,start:b9,x:b2,y:b3,",
     3.7 +    "03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,",
     3.8      "03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,",
     3.9      "03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,",
    3.10      "03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
    3.11 @@ -567,6 +568,7 @@
    3.12      "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,",
    3.13      "05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,",
    3.14      "03000000de280000ff11000001000000,Steam Virtual Gamepad,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,",
    3.15 +    "0500000011010000311400001b010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b32,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,",
    3.16      "03000000ad1b000038f0000090040000,Street Fighter IV FightStick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
    3.17      "03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,",
    3.18      "0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,",
     4.1 --- a/src/joystick/SDL_joystick.c	Mon Dec 16 10:26:36 2019 -0800
     4.2 +++ b/src/joystick/SDL_joystick.c	Mon Dec 16 17:11:23 2019 -0800
     4.3 @@ -1183,14 +1183,6 @@
     4.4      return GuessControllerName(vendor, product);
     4.5  }
     4.6  
     4.7 -SDL_bool
     4.8 -SDL_IsJoystickNintendoSwitchPro(Uint16 vendor, Uint16 product)
     4.9 -{
    4.10 -    EControllerType eType = GuessControllerType(vendor, product);
    4.11 -    return (eType == k_eControllerType_SwitchProController ||
    4.12 -            eType == k_eControllerType_SwitchInputOnlyController);
    4.13 -}
    4.14 -
    4.15  SDL_GameControllerType
    4.16  SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *name)
    4.17  {
     5.1 --- a/src/joystick/controller_type.h	Mon Dec 16 10:26:36 2019 -0800
     5.2 +++ b/src/joystick/controller_type.h	Mon Dec 16 17:11:23 2019 -0800
     5.3 @@ -218,8 +218,8 @@
     5.4  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0016 ), k_eControllerType_XBox360Controller, NULL },	// Hori Real Arcade Pro.EX
     5.5  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x001b ), k_eControllerType_XBox360Controller, NULL },	// Hori Real Arcade Pro VX
     5.6  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x008c ), k_eControllerType_XBox360Controller, NULL },	// Hori Real Arcade Pro 4
     5.7 -	{ MAKE_CONTROLLER_ID( 0x1038, 0x1430 ), k_eControllerType_XBox360Controller, NULL },	// SteelSeries Stratus Duo
     5.8 -	{ MAKE_CONTROLLER_ID( 0x1038, 0x1431 ), k_eControllerType_XBox360Controller, NULL },	// SteelSeries Stratus Duo
     5.9 +	{ MAKE_CONTROLLER_ID( 0x1038, 0x1430 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" },	// SteelSeries Stratus Duo
    5.10 +	{ MAKE_CONTROLLER_ID( 0x1038, 0x1431 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" },	// SteelSeries Stratus Duo
    5.11  	{ MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_XBox360Controller, NULL },	// SteelSeries Nimbus/Stratus XL
    5.12  	{ MAKE_CONTROLLER_ID( 0x11c9, 0x55f0 ), k_eControllerType_XBox360Controller, NULL },	// Nacon GC-100XF
    5.13  	{ MAKE_CONTROLLER_ID( 0x12ab, 0x0004 ), k_eControllerType_XBox360Controller, NULL },	// Honey Bee Xbox360 dancepad
     6.1 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c	Mon Dec 16 10:26:36 2019 -0800
     6.2 +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c	Mon Dec 16 17:11:23 2019 -0800
     6.3 @@ -255,6 +255,10 @@
     6.4          /* This is the NVIDIA Shield controller which doesn't talk Xbox controller protocol */
     6.5          return SDL_FALSE;
     6.6      }
     6.7 +    if (interface_number > 0) {
     6.8 +        /* This is the chatpad or other input interface, not the Xbox 360 interface */
     6.9 +        return SDL_FALSE;
    6.10 +    }
    6.11  #if defined(__MACOSX__) || defined(__WIN32__)
    6.12      if (vendor_id == 0x045e && product_id == 0x028e && version == 1) {
    6.13          /* This is the Steam Virtual Gamepad, which isn't supported by this driver */