Improved detection of third party PS4 and PS5 controllers

This commit is contained in:
Sam Lantinga
2022-09-22 23:42:25 -07:00
parent 7312b93d32
commit fa2063fb44
17 changed files with 132 additions and 51 deletions

View File

@@ -2167,6 +2167,11 @@ SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *nam
if (SDL_IsJoystickVirtual(guid)) {
return SDL_CONTROLLER_TYPE_VIRTUAL;
}
#ifdef SDL_JOYSTICK_HIDAPI
if (SDL_IsJoystickHIDAPI(guid)) {
return HIDAPI_GetGameControllerTypeFromGUID(guid);
}
#endif /* SDL_JOYSTICK_HIDAPI */
}
return type;
}