From: Thomas Huth <thuth@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>
Subject: [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys
Date: Wed, 10 Jan 2018 19:06:48 +0100 [thread overview]
Message-ID: <1515607608-18250-1-git-send-email-thuth@redhat.com> (raw)
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
next reply other threads:[~2018-01-10 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 18:06 Thomas Huth [this message]
2018-01-11 14:29 ` [Qemu-devel] [PATCH] ui/sdl2: Ignore key repeats for shortcut keys Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515607608-18250-1-git-send-email-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=kraxel@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).