Răsfoiți Sursa

Ignore spurious reply packets when reading Nintendo Switch controller reports

(cherry picked from commit 5ee9a840b1b5f8f1dc60cb831d0a1143153ce51d)
(cherry picked from commit f1b19aa744e7515181eeba848c4eb0dc6181c406)
Sam Lantinga 10 luni în urmă
părinte
comite
fbb9646806
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      src/joystick/hidapi/SDL_hidapi_switch.c

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

@@ -2214,6 +2214,10 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
             continue;
         }
 
+        if (ctx->m_rgucReadBuffer[0] == k_eSwitchInputReportIDs_SubcommandReply) {
+            continue;
+        }
+
         if (ctx->m_bInputOnly) {
             HandleInputOnlyControllerState(joystick, ctx, (SwitchInputOnlyControllerStatePacket_t *)&ctx->m_rgucReadBuffer[0]);
         } else {