From 274ea9dd005170176b2401558f06efd496654a9f Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 6 Jan 2025 16:23:43 +0300 Subject: [PATCH] engine: platform: sdl: clear key states on losing window focus --- engine/platform/sdl/events.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/platform/sdl/events.c b/engine/platform/sdl/events.c index f3b1448bf..4df5cf6df 100644 --- a/engine/platform/sdl/events.c +++ b/engine/platform/sdl/events.c @@ -396,8 +396,12 @@ static void SDLash_ActiveEvent( int gain ) } #endif host.status = HOST_NOFOCUS; + if( cls.key_dest == key_game ) + { + Key_ClearStates(); IN_DeactivateMouse(); + } host.force_draw_version_time = host.realtime + 2.0; VID_RestoreScreenResolution();