Added support for the Nintendo Switch Joy-Con Charging Grip
This commit is contained in:
parent
a8120104ad
commit
29cdb2c9c9
5 changed files with 57 additions and 14 deletions
|
@ -746,10 +746,16 @@ HIDAPI_CreateCombinedJoyCons()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!joycons[0] && SDL_IsJoystickNintendoSwitchJoyConLeft(device->vendor_id, device->product_id)) {
|
||||
if (!joycons[0] &&
|
||||
(SDL_IsJoystickNintendoSwitchJoyConLeft(device->vendor_id, device->product_id) ||
|
||||
(SDL_IsJoystickNintendoSwitchJoyConGrip(device->vendor_id, device->product_id) &&
|
||||
SDL_strstr(device->name, "(L)") != NULL))) {
|
||||
joycons[0] = device;
|
||||
}
|
||||
if (!joycons[1] && SDL_IsJoystickNintendoSwitchJoyConRight(device->vendor_id, device->product_id)) {
|
||||
if (!joycons[1] &&
|
||||
(SDL_IsJoystickNintendoSwitchJoyConRight(device->vendor_id, device->product_id) ||
|
||||
(SDL_IsJoystickNintendoSwitchJoyConGrip(device->vendor_id, device->product_id) &&
|
||||
SDL_strstr(device->name, "(R)") != NULL))) {
|
||||
joycons[1] = device;
|
||||
}
|
||||
if (joycons[0] && joycons[1]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue