浏览代码

Merge pull request #109750 from Nintorch/fix-get-connected-joypads

Handle SDL joypad events for connected controllers on game startup (on Windows and Linux)
Thaddeus Crews 2 月之前
父节点
当前提交
c8b89b84cc
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/sdl/joypad_sdl.cpp

+ 3 - 0
drivers/sdl/joypad_sdl.cpp

@@ -88,6 +88,9 @@ Error JoypadSDL::initialize() {
 		SDL_AddGamepadMappingsFromIO(rw, 1);
 		SDL_AddGamepadMappingsFromIO(rw, 1);
 	}
 	}
 
 
+	// Make sure that we handle already connected joypads when the driver is initialized.
+	process_events();
+
 	print_verbose("SDL: Init OK!");
 	print_verbose("SDL: Init OK!");
 	return OK;
 	return OK;
 }
 }