mirror of https://github.com/encounter/SDL.git
Fixed Joy-Con type detection for the Nintendo Joy-Con Charging Grip
This commit is contained in:
parent
a35cff634b
commit
ada55c690d
|
@ -1983,6 +1983,13 @@ SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const
|
|||
type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT;
|
||||
}
|
||||
|
||||
} else if (vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP) {
|
||||
if (name && SDL_strstr(name, "(L)") != NULL) {
|
||||
type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT;
|
||||
} else {
|
||||
type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT;
|
||||
}
|
||||
|
||||
} else if (vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR) {
|
||||
type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR;
|
||||
|
||||
|
|
Loading…
Reference in New Issue