@@ -253,21 +253,21 @@ void MoonlightInputManager::handleControllers(bool specialKey) {
253253
254254 short mappedControllersCount = controllersToMap ();
255255
256- if (lastControllerCount != controllersCount) {
257- lastControllerCount = controllersCount;
258-
259- for (int i = 0 ; i < controllersCount; i++) {
260- Logger::debug (" StreamingView: send features message for controller #{}" , i);
261- LiSendControllerArrivalEvent (i, mappedControllersCount, LI_CTYPE_UNKNOWN, 0 , LI_CCAP_RUMBLE | LI_CCAP_ACCEL | LI_CCAP_GYRO);
262- }
263- }
264-
265256 for (int i = 0 ; i < controllersCount; i++) {
266257 GamepadState gamepadState = getControllerState (i, specialKey);
267258
268259 if (!gamepadState.is_equal (lastGamepadStates[i])) {
269260 lastGamepadStates[i] = gamepadState;
270261
262+ if (lastControllerCount != controllersCount) {
263+ lastControllerCount = controllersCount;
264+
265+ for (int i = 0 ; i < controllersCount; i++) {
266+ Logger::debug (" StreamingView: send features message for controller #{}" , i);
267+ LiSendControllerArrivalEvent (i, mappedControllersCount, LI_CTYPE_UNKNOWN, 0 , LI_CCAP_RUMBLE | LI_CCAP_ACCEL | LI_CCAP_GYRO);
268+ }
269+ }
270+
271271 if (LiSendMultiControllerEvent (
272272 i, mappedControllersCount, gamepadState.buttonFlags ,
273273 gamepadState.leftTrigger , gamepadState.rightTrigger ,
0 commit comments