Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android

This commit is contained in:
Sam Lantinga
2020-01-18 11:21:14 -08:00
parent 27035425e0
commit 43aa1fa9e7
18 changed files with 244 additions and 141 deletions

View File

@@ -374,7 +374,7 @@ SDL_IsXInputDevice(const GUID* pGuidProductFromDirectInput)
if (SDL_memcmp(&pGuidProductFromDirectInput->Data4[2], "PIDVID", 6) == 0) {
Uint16 vendor_id = (Uint16)LOWORD(pGuidProductFromDirectInput->Data1);
Uint16 product_id = (Uint16)HIWORD(pGuidProductFromDirectInput->Data1);
SDL_GameControllerType type = SDL_GetJoystickGameControllerType(vendor_id, product_id, "");
SDL_GameControllerType type = SDL_GetJoystickGameControllerType("", vendor_id, product_id, -1, 0, 0, 0);
if (type == SDL_CONTROLLER_TYPE_XBOX360 ||
type == SDL_CONTROLLER_TYPE_XBOXONE ||
(vendor_id == 0x28DE && product_id == 0x11FF)) {