From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: programmingkidx@gmail.com, berrange@redhat.com,
peter.maydell@linaro.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [RFC PATCH 5/5] sdl2: use only QKeyCode in sdl2_process_key()
Date: Wed, 21 Feb 2018 18:08:20 +0100 [thread overview]
Message-ID: <20180221170820.15365-6-kraxel@redhat.com> (raw)
In-Reply-To: <20180221170820.15365-1-kraxel@redhat.com>
Small cleanup. Also drop the special backspace handling,
kbd_put_qcode_console() learned to handle that meanwhile.
And sdl2_process_key is never called with scon == NULL.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/sdl2-input.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c
index 82ec375ea2..f0847dd745 100644
--- a/ui/sdl2-input.c
+++ b/ui/sdl2-input.c
@@ -39,23 +39,19 @@ void sdl2_process_key(struct sdl2_console *scon,
SDL_KeyboardEvent *ev)
{
int qcode;
- QemuConsole *con = scon ? scon->dcl.con : NULL;
+ QemuConsole *con = scon->dcl.con;
if (ev->keysym.scancode >= qemu_input_map_usb_to_qcode_len) {
return;
}
-
qcode = qemu_input_map_usb_to_qcode[ev->keysym.scancode];
if (!qemu_console_is_graphic(con)) {
if (ev->type == SDL_KEYDOWN) {
- switch (ev->keysym.scancode) {
- case SDL_SCANCODE_RETURN:
+ switch (qcode) {
+ case Q_KEY_CODE_RET:
kbd_put_keysym_console(con, '\n');
break;
- case SDL_SCANCODE_BACKSPACE:
- kbd_put_keysym_console(con, QEMU_KEY_BACKSPACE);
- break;
default:
kbd_put_qcode_console(con, qcode);
break;
--
2.9.3
next prev parent reply other threads:[~2018-02-21 17:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 17:08 [Qemu-devel] [RFC PATCH 0/5] ui: add keyboard state and hotkey tracker Gerd Hoffmann
2018-02-21 17:08 ` [Qemu-devel] [RFC PATCH 1/5] kbd-state: add keyboard state tracker Gerd Hoffmann
2018-02-21 17:08 ` [Qemu-devel] [RFC PATCH 2/5] kbd-state: add hotkey registry Gerd Hoffmann
2018-06-01 19:05 ` Programmingkid
2018-06-05 10:20 ` Gerd Hoffmann
2018-06-05 14:37 ` Programmingkid
2018-02-21 17:08 ` [Qemu-devel] [RFC PATCH 3/5] kbd-state: use state tracker for sdl2 Gerd Hoffmann
2018-02-21 17:08 ` [Qemu-devel] [RFC PATCH 4/5] kbd-state: register sdl2 hotkeys Gerd Hoffmann
2018-02-21 17:08 ` Gerd Hoffmann [this message]
2018-02-22 14:14 ` [Qemu-devel] [RFC PATCH 0/5] ui: add keyboard state and hotkey tracker no-reply
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=20180221170820.15365-6-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=programmingkidx@gmail.com \
--cc=qemu-devel@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).