Skip to content

Commit 8442d4f

Browse files
endriftslouken
authored andcommitted
joystick: Add support Xbox Adaptive Controller
The Xbox Adaptive Controller reports the pressed guide button state as 2 instead of 1. This is contrary to the spec, but it's needed for the guide button to work. This also adds a bit more documentation on observed-but-not-known GUIDs.
1 parent 3cd979b commit 8442d4f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/joystick/hidapi/SDL_hidapi_gip.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ MAKE_GUID(GUID_Wheel, 0x646979cf, 0x6b71, 0x4e96, 0x8d, 0xf9, 0x59, 0xe3, 0x98,
317317
* MAKE_GUID(GUID_IProgrammableGamepad, 0x31c1034d, 0xb5b7, 0x4551, 0x98, 0x13, 0x87, 0x69, 0xd4, 0xa0, 0xe4, 0xf9);
318318
* MAKE_GUID(GUID_IVirtualDevice, 0xdfd26825, 0x110a, 0x4e94, 0xb9, 0x37, 0xb2, 0x7c, 0xe4, 0x7b, 0x25, 0x40);
319319
* MAKE_GUID(GUID_OnlineDevAuth, 0x632b1fd1, 0xa3e9, 0x44f9, 0x84, 0x20, 0x5c, 0xe3, 0x44, 0xa0, 0x64, 0x04);
320+
*
321+
* Seen on Elite Controller, Adaptive Controller: 9ebd00a3-b5e6-4c08-a33b-673126459ec4
322+
* Seen on Adaptive Controller: ce1e58c5-221c-4bdb-9c24-bf3941601320
323+
* Seen on Elite 2 Controller: f758dc66-022c-48b8-a4f6-457ba80e2a5b (IControllerProfileModeState)
324+
* Seen on Elite 2 Controller: 31c1034d-b5b7-4551-9813-8769d4a0e4f9 (IProgrammableGamepad)
325+
* Seen on Elite 2 Controller: 34ad9b1e-36ad-4fb5-8ac7-17234c9f546f (IExtendedDeviceFlags)
326+
* Seen on Elite 2 Controller: 88e0b694-6bd9-4416-a560-e7fafdfa528f
327+
* Seen on Elite 2 Controller: ea96c8c0-b216-448b-be80-7e5deb0698e2
320328
*/
321329

322330
static const int GIP_DataClassMtu[8] = { 64, 64, 64, 2048, 0, 0, 0, 0 };
@@ -1687,7 +1695,7 @@ static bool GIP_HandleCommandGuideButtonStatus(
16871695
return false;
16881696
}
16891697
if (bytes[1] == VK_LWIN) {
1690-
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_GUIDE, (bytes[0] & 0x01) != 0);
1698+
SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_GUIDE, (bytes[0] & 0x03) != 0);
16911699
}
16921700

16931701
return true;

0 commit comments

Comments
 (0)