Use the correct name for the DualSense controllers
This commit is contained in:
parent
9339085593
commit
9a6bcca6b8
2 changed files with 6 additions and 2 deletions
|
@ -1809,7 +1809,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c
|
||||||
name = SDL_strdup("PS4 Controller");
|
name = SDL_strdup("PS4 Controller");
|
||||||
break;
|
break;
|
||||||
case SDL_CONTROLLER_TYPE_PS5:
|
case SDL_CONTROLLER_TYPE_PS5:
|
||||||
name = SDL_strdup("PS5 Controller");
|
name = SDL_strdup("DualSense Wireless Controller");
|
||||||
break;
|
break;
|
||||||
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO:
|
case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO:
|
||||||
name = SDL_strdup("Nintendo Switch Pro Controller");
|
name = SDL_strdup("Nintendo Switch Pro Controller");
|
||||||
|
|
|
@ -480,7 +480,11 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
||||||
device->joystick_type = joystick_type;
|
device->joystick_type = joystick_type;
|
||||||
device->type = SDL_CONTROLLER_TYPE_PS5;
|
device->type = SDL_CONTROLLER_TYPE_PS5;
|
||||||
if (device->vendor_id == USB_VENDOR_SONY) {
|
if (device->vendor_id == USB_VENDOR_SONY) {
|
||||||
HIDAPI_SetDeviceName(device, "PS5 Controller");
|
if (SDL_IsJoystickDualSenseEdge(device->vendor_id, device->product_id)) {
|
||||||
|
HIDAPI_SetDeviceName(device, "DualSense Edge Wireless Controller");
|
||||||
|
} else {
|
||||||
|
HIDAPI_SetDeviceName(device, "DualSense Wireless Controller");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
HIDAPI_SetDeviceSerial(device, serial);
|
HIDAPI_SetDeviceSerial(device, serial);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue