Fixed RAWINPUT_IsDevicePresent() not returning TRUE for Xbox One controllers

This commit is contained in:
Sam Lantinga 2020-11-27 10:44:49 -08:00
parent 8a449de20d
commit ce77966da8
3 changed files with 10 additions and 1 deletions

View file

@ -942,6 +942,13 @@ RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, co
return SDL_TRUE;
}
/* The Xbox One controller shows up as a hardcoded raw input VID/PID */
if (name && SDL_strcmp(name, "Xbox One Game Controller") == 0 &&
device->vendor_id == USB_VENDOR_MICROSOFT &&
device->product_id == USB_PRODUCT_XBOX_ONE_RAW_INPUT_CONTROLLER) {
return SDL_TRUE;
}
device = device->next;
}
return SDL_FALSE;