[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/42] sdl2: switch keyboard handling to new core
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 15/42] sdl2: switch keyboard handling to new core |
Date: |
Tue, 28 Jan 2014 10:57:08 +0100 |
---
ui/sdl2.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index e7a30b3..ac3ac19 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -33,6 +33,7 @@
#include "qemu-common.h"
#include "ui/console.h"
+#include "ui/input.h"
#include "sysemu/sysemu.h"
#include "x_keymap.h"
#include "sdl_zoom.h"
@@ -236,9 +237,7 @@ static void reset_keys(void)
int i;
for(i = 0; i < 256; i++) {
if (modifiers_state[i]) {
- if (i & SCANCODE_GREY)
- kbd_put_keycode(SCANCODE_EMUL0);
- kbd_put_keycode(i | SCANCODE_UP);
+ qemu_input_event_send_key_number(NULL, i, false);
modifiers_state[i] = 0;
}
}
@@ -246,11 +245,12 @@ static void reset_keys(void)
static void sdl_process_key(SDL_KeyboardEvent *ev)
{
- int keycode, v;
+ int keycode;
+#if 0
if (ev->keysym.sym == SDLK_PAUSE) {
/* specific case */
- v = 0;
+ int v = 0;
if (ev->type == SDL_KEYUP)
v |= SCANCODE_UP;
kbd_put_keycode(0xe1);
@@ -258,6 +258,7 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
kbd_put_keycode(0x45 | v);
return;
}
+#endif
if (kbd_layout) {
keycode = sdl_keyevent_to_keycode_generic(ev);
@@ -284,18 +285,14 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
case 0x45: /* num lock */
case 0x3a: /* caps lock */
/* SDL does not send the key up event, so we generate it */
- kbd_put_keycode(keycode);
- kbd_put_keycode(keycode | SCANCODE_UP);
+ qemu_input_event_send_key_number(NULL, keycode, true);
+ qemu_input_event_send_key_number(NULL, keycode, false);
return;
}
/* now send the key code */
- if (keycode & SCANCODE_GREY)
- kbd_put_keycode(SCANCODE_EMUL0);
- if (ev->type == SDL_KEYUP)
- kbd_put_keycode(keycode | SCANCODE_UP);
- else
- kbd_put_keycode(keycode & SCANCODE_KEYCODEMASK);
+ qemu_input_event_send_key_number(NULL, keycode,
+ ev->type == SDL_KEYDOWN);
}
static void sdl_update_caption(struct sdl2_console_state *scon)
--
1.8.3.1
- [Qemu-devel] [PATCH 14/42] input: keyboard: switch sdl ui to new core, (continued)
- [Qemu-devel] [PATCH 14/42] input: keyboard: switch sdl ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 18/42] input: keyboard: switch curses ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 09/42] input: add core bits of the new input layer, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 23/42] input: mouse: switch gtk ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 05/42] input: rename file to legacy, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 13/42] input: keyboard: switch gtk ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 11/42] input: keyboard: switch legacy handlers to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 25/42] sdl2: switch mouse handling to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 16/42] input: keyboard: switch vnc ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 27/42] input: mouse: switch spice ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 15/42] sdl2: switch keyboard handling to new core,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 06/42] input: qapi: define event types, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 26/42] input: mouse: switch vnc ui to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 22/42] input: mouse: switch legacy handlers to new core, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 35/42] input-legacy: remove kbd_mouse_event, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 31/42] input: trace events, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 33/42] input-legacy: remove kbd_mouse_has_absolute, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 20/42] input: mouse: add graphic_rotate support, Gerd Hoffmann, 2014/01/28
- [Qemu-devel] [PATCH 34/42] input-legacy: remove kbd_mouse_is_absolute, Gerd Hoffmann, 2014/01/28