[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/42] input: keyboard: switch spice ui to new core
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 17/42] input: keyboard: switch spice ui to new core |
Date: |
Mon, 16 Dec 2013 11:48:53 +0100 |
---
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 37/42] input: add input_mouse_mode tracepoint, (continued)
- [Qemu-devel] [PATCH 37/42] input: add input_mouse_mode tracepoint, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 41/42] input: move do_mouse_set to new core, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 34/42] input-legacy: remove kbd_mouse_is_absolute, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 30/42] input: mouse: switch cocoa ui to new core [untested], Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 07/42] input: qapi: add unmapped key, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 26/42] input: mouse: switch vnc ui to new core, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 40/42] input: move qmp_query_mice to new core, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 42/42] input: remove index_from_keycode (no users), Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 38/42] sdl2: simplify keymap handling, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 39/42] sdl2: codestyle fixups, Gerd Hoffmann, 2013/12/16
- [Qemu-devel] [PATCH 17/42] input: keyboard: switch spice ui to new core,
Gerd Hoffmann <=