Allow HIDAPI controllers to override the default joystick type

This commit is contained in:
Sam Lantinga
2022-09-23 00:15:40 -07:00
parent 899a1e7cba
commit b7940c29cc
3 changed files with 29 additions and 0 deletions

View File

@@ -2525,6 +2525,12 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid)
return SDL_JOYSTICK_TYPE_THROTTLE;
}
#ifdef SDL_JOYSTICK_HIDAPI
if (SDL_IsJoystickHIDAPI(guid)) {
return HIDAPI_GetJoystickTypeFromGUID(guid);
}
#endif /* SDL_JOYSTICK_HIDAPI */
if (GuessControllerType(vendor, product) != k_eControllerType_UnknownNonSteamController) {
return SDL_JOYSTICK_TYPE_GAMECONTROLLER;
}