diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-01-22 10:28:10 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-05 10:45:44 +0100 |
commit | 06f894dbcc5a9d4e2e352f2b6df68af0da24d5e7 (patch) | |
tree | 4bf2c378baa2495912d75ade76666772ed8c6d46 /ui | |
parent | 07333e1ca382ed570d781a99ee8c168cb8b252d0 (diff) |
sdl2: use only QKeyCode in sdl2_process_key()
Also: sdl2_process_key is never called with scon == NULL.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190122092814.14919-5-kraxel@redhat.com
Diffstat (limited to 'ui')
-rw-r--r-- | ui/sdl2-input.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c index 22e3336aab..664364a5e5 100644 --- a/ui/sdl2-input.c +++ b/ui/sdl2-input.c @@ -34,20 +34,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]; qkbd_state_key_event(scon->kbd, qcode, ev->type == SDL_KEYDOWN); if (!qemu_console_is_graphic(con)) { bool ctrl = qkbd_state_modifier_get(scon->kbd, QKBD_MOD_CTRL); 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; default: |