diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index e3acc7c82a..6907115809 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -60,6 +60,7 @@ void sdl2_poll_events(struct sdl2_console *scon); void sdl2_process_key(struct sdl2_console *scon, SDL_KeyboardEvent *ev); +void sdl2_release_modifiers(struct sdl2_console *scon); void sdl2_2d_update(DisplayChangeListener *dcl, int x, int y, int w, int h); diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c index b02a89ee7c..2286df4223 100644 --- a/ui/sdl2-input.c +++ b/ui/sdl2-input.c @@ -58,3 +58,8 @@ void sdl2_process_key(struct sdl2_console *scon, } } } + +void sdl2_release_modifiers(struct sdl2_console *scon) +{ + qkbd_state_lift_all_keys(scon->kbd); +} diff --git a/ui/sdl2.c b/ui/sdl2.c index 251ce97796..71a0d471d1 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -418,6 +418,7 @@ static void handle_keydown(SDL_Event *ev) SDL_ShowWindow(sdl2_console[win].real_window); } } + sdl2_release_modifiers(scon); gui_keysym = 1; } break;