Separate the controller protocol from the controller style

This allows us to handle controllers that use the Xbox protocol but look like Nintendo Switch or Playstation controllers, like the Qanba Dragon Arcade Stick in PC mode
This commit is contained in:
Sam Lantinga
2022-06-15 20:44:43 -07:00
parent 94f6080895
commit 16f55fbdb4
6 changed files with 211 additions and 202 deletions

View File

@@ -253,7 +253,7 @@ SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char* hidPath)
return SDL_TRUE;
}
type = SDL_GetJoystickGameControllerType("", vendor_id, product_id, -1, 0, 0, 0);
type = SDL_GetJoystickGameControllerTypeFromVIDPID(vendor_id, product_id, NULL, SDL_FALSE);
if (type == SDL_CONTROLLER_TYPE_XBOX360 ||
type == SDL_CONTROLLER_TYPE_XBOXONE ||
(vendor_id == USB_VENDOR_VALVE && product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD)) {