|
@@ -288,6 +288,7 @@ static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
|
|
|
(is_ps4 && HIDAPI_IsDeviceTypePresent(SDL_GAMEPAD_TYPE_PS4)) ||
|
|
|
(is_ps5 && HIDAPI_IsDeviceTypePresent(SDL_GAMEPAD_TYPE_PS5)) ||
|
|
|
(is_switch_pro && HIDAPI_IsDeviceTypePresent(SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO)) ||
|
|
|
+ (is_switch_joycon_pair && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR, 0, "")) ||
|
|
|
(is_stadia && HIDAPI_IsDeviceTypePresent(SDL_GAMEPAD_TYPE_GOOGLE_STADIA))) {
|
|
|
/* The HIDAPI driver is taking care of this device */
|
|
|
return FALSE;
|
|
@@ -443,6 +444,17 @@ static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
|
|
|
BOOL is_switch_joyconR = IsControllerSwitchJoyConR(controller);
|
|
|
int nbuttons = 0;
|
|
|
|
|
|
+#ifdef SDL_JOYSTICK_HIDAPI
|
|
|
+ if ((is_switch_joyconL && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT, 0, "")) ||
|
|
|
+ (is_switch_joyconR && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT, 0, ""))) {
|
|
|
+ /* The HIDAPI driver is taking care of this device */
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+#else
|
|
|
+ (void)is_switch_joyconL;
|
|
|
+ (void)is_switch_joyconR;
|
|
|
+#endif
|
|
|
+
|
|
|
if (is_switch_joyconL) {
|
|
|
vendor = USB_VENDOR_NINTENDO;
|
|
|
product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT;
|