mirror of
https://github.com/encounter/SDL.git
synced 2025-12-12 22:56:09 +00:00
Fixed RAWINPUT_IsDevicePresent() not returning TRUE for Xbox One controllers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user