[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/44] input: keyboard: switch spice ui to new core
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 17/44] input: keyboard: switch spice ui to new core |
Date: |
Mon, 24 Feb 2014 12:52:24 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/spice-input.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/ui/spice-input.c b/ui/spice-input.c
index 3beb8de..c9df699 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -26,12 +26,15 @@
#include "qemu-common.h"
#include "ui/qemu-spice.h"
#include "ui/console.h"
+#include "ui/keymaps.h"
+#include "ui/input.h"
/* keyboard bits */
typedef struct QemuSpiceKbd {
SpiceKbdInstance sin;
int ledstate;
+ bool emul0;
} QemuSpiceKbd;
static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag);
@@ -47,9 +50,24 @@ static const SpiceKbdInterface kbd_interface = {
.get_leds = kbd_get_leds,
};
-static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag)
+static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
{
- kbd_put_keycode(frag);
+ QemuSpiceKbd *kbd = container_of(sin, QemuSpiceKbd, sin);
+ int keycode;
+ bool up;
+
+ if (scancode == SCANCODE_EMUL0) {
+ kbd->emul0 = true;
+ return;
+ }
+ keycode = scancode & ~SCANCODE_UP;
+ up = scancode & SCANCODE_UP;
+ if (kbd->emul0) {
+ kbd->emul0 = false;
+ keycode |= SCANCODE_GREY;
+ }
+
+ qemu_input_event_send_key_number(NULL, keycode, !up);
}
static uint8_t kbd_get_leds(SpiceKbdInstance *sin)
--
1.8.3.1
- [Qemu-devel] [PATCH 01/44] ui/sdl2 : initial port to SDL 2.0 (v2.0), (continued)
- [Qemu-devel] [PATCH 01/44] ui/sdl2 : initial port to SDL 2.0 (v2.0), Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 25/44] sdl2: switch mouse handling to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 05/44] input: rename file to legacy, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 40/44] input: move qmp_query_mice to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 21/44] input: mouse: add qemu_input_is_absolute(), Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 07/44] input: qapi: add unmapped key, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 29/44] input: keyboard: switch cocoa ui to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 06/44] input: qapi: define event types, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 15/44] sdl2: switch keyboard handling to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 19/44] input: mouse: add helpers functions to core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 17/44] input: keyboard: switch spice ui to new core,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 31/44] input: trace events, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 16/44] input: keyboard: switch vnc ui to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 36/44] input: move mouse mode notifier to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 28/44] input: mouse: switch monitor to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 41/44] input: move do_mouse_set to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 43/44] console: add head to index to qemu consoles., Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 03/44] sdl2: remove text console logic, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 13/44] input: keyboard: switch gtk ui to new core, Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 12/44] input: keyboard: switch qmp_send_key() to new core., Gerd Hoffmann, 2014/02/24
- [Qemu-devel] [PATCH 23/44] input: mouse: switch gtk ui to new core, Gerd Hoffmann, 2014/02/24