Flush stale gamepad events after checking for unmapped gamepads

This commit is contained in:
Cameron Gutman 2024-03-31 14:56:46 -05:00
parent cf544a8703
commit 8a87a09947

View file

@ -955,6 +955,10 @@ QString SdlInputHandler::getUnmappedGamepads()
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
// Flush stale events so they aren't processed by the main session event loop
SDL_FlushEvents(SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED);
SDL_FlushEvents(SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMAPPED);
return ret;
}