[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi |
Date: |
Thu, 28 Nov 2013 15:29:58 +0100 |
Define input event types, using qapi. So we get nicely autogenerated
types for our input events. And when it comes to qmp support some day
things will be alot easier.
Types are modeled after the linux input layer. There are separate
event types for each value. There is a sync to indicate the end
of a event group.
Mouse events are splitted into motion events (one for each axis) and
button events, which are grouped by sync.
Keyboard events are using keycodes instead of scancodes, so we can
rid of the keycode->scancode transformation everywhere in the
ui code.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
qapi-schema.json | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/qapi-schema.json b/qapi-schema.json
index 83fa485..c27c49d 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4213,3 +4213,32 @@
# Since: 1.7
##
{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
+
+
+###########################################################
+# WIP - input event data structures
+# not exposed via qmp yet, needs testing first
+
+{ 'enum' : 'InputButton',
+ 'data' : [ 'Left', 'Middle', 'Right' ] }
+
+{ 'enum' : 'InputAxis',
+ 'data' : [ 'X', 'Y' ] }
+
+{ 'type' : 'InputKeyEvent',
+ 'data' : { 'keycode' : 'int',
+ 'down' : 'bool' } }
+
+{ 'type' : 'InputBtnEvent',
+ 'data' : { 'button' : 'InputButton',
+ 'down' : 'bool' } }
+
+{ 'type' : 'InputMoveEvent',
+ 'data' : { 'axis' : 'InputAxis',
+ 'value' : 'int' } }
+
+{ 'union' : 'InputEvent',
+ 'data' : { 'key' : 'InputKeyEvent',
+ 'btn' : 'InputBtnEvent',
+ 'rel' : 'InputMoveEvent',
+ 'abs' : 'InputMoveEvent' } }
--
1.8.3.1
- [Qemu-devel] [RFC PATCH 00/15] input: rewrite qemu input layer, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi,
Gerd Hoffmann <=
- [Qemu-devel] [RFC PATCH 13/15] input: mouse: switch legacy handlers to new core, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 02/15] input: rename file to legacy, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 01/15] console: export QemuConsole index, width, height, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 05/15] input: keyboard: add helper functions to core, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 06/15] input: keyboard: switch legacy handlers to new core, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 07/15] input: keyboard: switch qmp_send_key() to new core., Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 15/15] input: mouse: switch sdl ui to new core, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 10/15] input: mouse: add helpers functions to core, Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 09/15] input: keyboard: switch sdl ui to new core [wip], Gerd Hoffmann, 2013/11/28
- [Qemu-devel] [RFC PATCH 12/15] input: mouse: add qemu_input_is_absolute(), Gerd Hoffmann, 2013/11/28