mirror of https://github.com/libsdl-org/SDL.git
Don't send k_ePS4FeatureReportIdCapabilities to Sony PS4 controllers
This report is for third party controllers only, and might be causing issues with fake PS4 controllers. Reference https://github.com/libsdl-org/SDL/issues/7960
This commit is contained in:
parent
5ce967a579
commit
092a4b780c
|
|
@ -307,6 +307,14 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device->vendor_id == USB_VENDOR_SONY) {
|
||||||
|
ctx->official_controller = SDL_TRUE;
|
||||||
|
ctx->sensors_supported = SDL_TRUE;
|
||||||
|
ctx->lightbar_supported = SDL_TRUE;
|
||||||
|
ctx->vibration_supported = SDL_TRUE;
|
||||||
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
|
} else {
|
||||||
|
/* Third party controller capability request */
|
||||||
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data));
|
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data));
|
||||||
/* Get the device capabilities */
|
/* Get the device capabilities */
|
||||||
if (size == 48 && data[2] == 0x27) {
|
if (size == 48 && data[2] == 0x27) {
|
||||||
|
|
@ -368,17 +376,12 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
||||||
ctx->accel_numerator = accel_numerator;
|
ctx->accel_numerator = accel_numerator;
|
||||||
ctx->accel_denominator = accel_denominator;
|
ctx->accel_denominator = accel_denominator;
|
||||||
}
|
}
|
||||||
} else if (device->vendor_id == USB_VENDOR_SONY) {
|
|
||||||
ctx->official_controller = SDL_TRUE;
|
|
||||||
ctx->sensors_supported = SDL_TRUE;
|
|
||||||
ctx->lightbar_supported = SDL_TRUE;
|
|
||||||
ctx->vibration_supported = SDL_TRUE;
|
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
|
||||||
} else if (device->vendor_id == USB_VENDOR_RAZER) {
|
} else if (device->vendor_id == USB_VENDOR_RAZER) {
|
||||||
/* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */
|
/* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */
|
||||||
ctx->vibration_supported = SDL_TRUE;
|
ctx->vibration_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported);
|
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported);
|
||||||
|
|
||||||
if (device->vendor_id == USB_VENDOR_PDP &&
|
if (device->vendor_id == USB_VENDOR_PDP &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue