mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
Don't probe for PlayStation controllers when we already know the controller type
Fixes https://github.com/libsdl-org/SDL/issues/7556
This commit is contained in:
@@ -135,6 +135,13 @@ void HIDAPI_DumpPacket(const char *prefix, const Uint8 *data, int size)
|
|||||||
|
|
||||||
SDL_bool HIDAPI_SupportsPlaystationDetection(Uint16 vendor, Uint16 product)
|
SDL_bool HIDAPI_SupportsPlaystationDetection(Uint16 vendor, Uint16 product)
|
||||||
{
|
{
|
||||||
|
/* If we already know the controller is a different type, don't try to detect it.
|
||||||
|
* This fixes a hang with the HORIPAD for Nintendo Switch (0x0f0d/0x00c1)
|
||||||
|
*/
|
||||||
|
if (SDL_GetGamepadTypeFromVIDPID(vendor, product, NULL, SDL_FALSE) != SDL_GAMEPAD_TYPE_UNKNOWN) {
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (vendor) {
|
switch (vendor) {
|
||||||
case USB_VENDOR_DRAGONRISE:
|
case USB_VENDOR_DRAGONRISE:
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
|
Reference in New Issue
Block a user