* [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys
@ 2018-01-10 18:06 Thomas Huth
2018-01-11 14:29 ` Michael Tokarev
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2018-01-10 18:06 UTC (permalink / raw)
To: Gerd Hoffmann, qemu-devel; +Cc: qemu-trivial, Michael Tokarev
Holding down a shortcut key currently continuesly triggers the shortcut
event, e.g. holding CTRL-ALT-f continuesly switches between windowed and
fullscreen mode, or holding CTRL-ALT-u even crashes QEMU with a segfault.
This is ugly, we should rather ignore automatic key repeats when handling
the keyboard shortcuts.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
ui/sdl2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 8718cf3..18664b4 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -349,7 +349,7 @@ static void handle_keydown(SDL_Event *ev)
}
gui_key_modifier_pressed = mod_state;
- if (gui_key_modifier_pressed) {
+ if (gui_key_modifier_pressed && !ev->key.repeat) {
switch (ev->key.keysym.scancode) {
case SDL_SCANCODE_2:
case SDL_SCANCODE_3:
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys
2018-01-10 18:06 [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys Thomas Huth
@ 2018-01-11 14:29 ` Michael Tokarev
0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2018-01-11 14:29 UTC (permalink / raw)
To: Thomas Huth, Gerd Hoffmann, qemu-devel; +Cc: qemu-trivial
10.01.2018 21:06, Thomas Huth wrote:
> Holding down a shortcut key currently continuesly triggers the shortcut
> event, e.g. holding CTRL-ALT-f continuesly switches between windowed and
> fullscreen mode, or holding CTRL-ALT-u even crashes QEMU with a segfault.
> This is ugly, we should rather ignore automatic key repeats when handling
> the keyboard shortcuts.
Applied to -trivial, thank you!
/mjt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-11 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 18:06 [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys Thomas Huth
2018-01-11 14:29 ` Michael Tokarev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).