ui/sdl2: release all modifiers
Each virtual console in the SDL2 frontend has a key state map. When switching windows with GUI keys we have to release all pressed modifier keys in the currently active window, because after the switch the now inactive window no longer receives the key release events. To reproduce the issue open a text editor in the SDL UI and then press Ctrl-Alt-2 to open a Compat Monitor Console. Close the console with the mouse. Try to enter text in the text editor and notice that the modifier keys Ctrl and Alt are stuck and need to be pressed once to be released. Tested-by: Howard Spoelstra <hsp.cat7@gmail.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Tested-by: Bernhard Beschow <shentey@gmail.com> Message-ID: <20240909061552.6122-2-vr_qemu@t-online.de> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
6e7d8c5f3d
commit
df3c610ffc
@ -60,6 +60,7 @@ void sdl2_poll_events(struct sdl2_console *scon);
|
|||||||
|
|
||||||
void sdl2_process_key(struct sdl2_console *scon,
|
void sdl2_process_key(struct sdl2_console *scon,
|
||||||
SDL_KeyboardEvent *ev);
|
SDL_KeyboardEvent *ev);
|
||||||
|
void sdl2_release_modifiers(struct sdl2_console *scon);
|
||||||
|
|
||||||
void sdl2_2d_update(DisplayChangeListener *dcl,
|
void sdl2_2d_update(DisplayChangeListener *dcl,
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h);
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user