From 197961ddc933f3a06ba3bc556b0e994963e145b7 Mon Sep 17 00:00:00 2001 From: Nintorch <92302738+Nintorch@users.noreply.github.com> Date: Mon, 18 Aug 2025 23:55:20 +0500 Subject: [PATCH] Process SDL joypad events on startup Make sure that SDL events are processed when the SDL joypad input driver is initialized, this will allow it to register the connected controllers when a game starts. --- drivers/sdl/joypad_sdl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/sdl/joypad_sdl.cpp b/drivers/sdl/joypad_sdl.cpp index 693b4a216944..ce88572392f0 100644 --- a/drivers/sdl/joypad_sdl.cpp +++ b/drivers/sdl/joypad_sdl.cpp @@ -88,6 +88,9 @@ Error JoypadSDL::initialize() { SDL_AddGamepadMappingsFromIO(rw, 1); } + // Make sure that we handle already connected joypads when the driver is initialized. + process_events(); + print_verbose("SDL: Init OK!"); return OK; }