mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-07 10:26:27 +00:00
Improved detection of third party PS4 and PS5 controllers
This commit is contained in:
@@ -112,8 +112,6 @@ HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device)
|
||||
{
|
||||
SDL_DriverShield_Context *ctx;
|
||||
|
||||
HIDAPI_SetDeviceName(device, "NVIDIA SHIELD Controller");
|
||||
|
||||
ctx = (SDL_DriverShield_Context *)SDL_calloc(1, sizeof(*ctx));
|
||||
if (!ctx) {
|
||||
SDL_OutOfMemory();
|
||||
@@ -121,6 +119,9 @@ HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
device->context = ctx;
|
||||
|
||||
device->type = SDL_CONTROLLER_TYPE_NVIDIA_SHIELD;
|
||||
HIDAPI_SetDeviceName(device, "NVIDIA SHIELD Controller");
|
||||
|
||||
return HIDAPI_JoystickConnected(device, NULL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user