From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2c1-0001ea-P0 for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vm2bv-0006kS-Ji for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm2bv-0006kI-Ai for qemu-devel@nongnu.org; Thu, 28 Nov 2013 09:30:31 -0500 From: Gerd Hoffmann Date: Thu, 28 Nov 2013 15:29:58 +0100 Message-Id: <1385649010-7034-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1385649010-7034-1-git-send-email-kraxel@redhat.com> References: <1385649010-7034-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Dave Airlie , Gerd Hoffmann , Markus Armbruster , Luiz Capitulino 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 --- 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