aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-11-28 11:40:27 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-03-05 09:50:17 +0100
commitaf98ba92ac3b417fa171736180a782f84b202cef (patch)
tree8d065e3c2a24f299a566e218b1ef8aa87c594070 /ui/gtk.c
parentd2a9260335876ce9d17be0dabf0fd4ae1593de66 (diff)
downloadqemu-af98ba92ac3b417fa171736180a782f84b202cef.zip
qemu-af98ba92ac3b417fa171736180a782f84b202cef.tar.gz
qemu-af98ba92ac3b417fa171736180a782f84b202cef.tar.bz2
input: keyboard: switch gtk ui to new core
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index a633d89..74c0936 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -59,6 +59,7 @@
#include "trace.h"
#include "ui/console.h"
+#include "ui/input.h"
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
#include "x_keymap.h"
@@ -280,10 +281,7 @@ static void gtk_release_modifiers(GtkDisplayState *s)
if (!s->modifier_pressed[i]) {
continue;
}
- if (keycode & SCANCODE_GREY) {
- kbd_put_keycode(SCANCODE_EMUL0);
- }
- kbd_put_keycode(keycode | SCANCODE_UP);
+ qemu_input_event_send_key_number(s->dcl.con, keycode, false);
s->modifier_pressed[i] = false;
}
}
@@ -745,17 +743,8 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
}
}
- if (qemu_keycode & SCANCODE_GREY) {
- kbd_put_keycode(SCANCODE_EMUL0);
- }
-
- if (key->type == GDK_KEY_PRESS) {
- kbd_put_keycode(qemu_keycode & SCANCODE_KEYCODEMASK);
- } else if (key->type == GDK_KEY_RELEASE) {
- kbd_put_keycode(qemu_keycode | SCANCODE_UP);
- } else {
- g_assert_not_reached();
- }
+ qemu_input_event_send_key_number(s->dcl.con, qemu_keycode,
+ key->type == GDK_KEY_PRESS);
return TRUE;
}