mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-19 17:58:13 +00:00
Allow HIDAPI controllers to override the default joystick type
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user