Просмотр исходного кода

Don't put wired Switch Pro controllers into simple report mode

This stops the controller from sending input or responding to queries until it's unplugged.
Sam Lantinga 1 год назад
Родитель
Сommit
eb89d0c8c3
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      src/joystick/hidapi/SDL_hidapi_switch.c

+ 6 - 0
src/joystick/hidapi/SDL_hidapi_switch.c

@@ -813,6 +813,12 @@ static Uint8 GetDefaultInputMode(SDL_DriverSwitch_Context *ctx)
         }
         break;
     }
+
+    // Wired controllers break if they are put into simple controller state
+    if (input_mode == k_eSwitchInputReportIDs_SimpleControllerState &&
+        !ctx->device->is_bluetooth) {
+        input_mode = k_eSwitchInputReportIDs_FullControllerState;
+    }
     return input_mode;
 }