From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W85Qe-0000xG-Pt for qemu-devel@nongnu.org; Tue, 28 Jan 2014 04:58:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W85QT-0006g6-0W for qemu-devel@nongnu.org; Tue, 28 Jan 2014 04:58:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W85QS-0006fa-N5 for qemu-devel@nongnu.org; Tue, 28 Jan 2014 04:57:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0S9vljK021316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 Jan 2014 04:57:47 -0500 From: Gerd Hoffmann Date: Tue, 28 Jan 2014 10:56:59 +0100 Message-Id: <1390903055-479-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1390903055-479-1-git-send-email-kraxel@redhat.com> References: <1390903055-479-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 06/42] input: qapi: define event types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Gerd Hoffmann , 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 the existing KeyValue type. Signed-off-by: Gerd Hoffmann --- qapi-schema.json | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 05ced9d..646d64f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4419,3 +4419,79 @@ # Since: 1.7 ## { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } } + +## +# @InputButton +# +# Button of a pointer input device (mouse, tablet). +# +# Since: 2.0 +## +{ 'enum' : 'InputButton', + 'data' : [ 'Left', 'Middle', 'Right', 'WheelUp', 'WheelDown' ] } + +## +# @InputButton +# +# Position axis of a pointer input device (mouse, tablet). +# +# Since: 2.0 +## +{ 'enum' : 'InputAxis', + 'data' : [ 'X', 'Y' ] } + +## +# @InputKeyEvent +# +# Keyboard input event. +# +# @key: Which key this event is for. +# @down: True for key-down and false for key-up events. +# +# Since: 2.0 +## +{ 'type' : 'InputKeyEvent', + 'data' : { 'key' : 'KeyValue', + 'down' : 'bool' } } + +## +# @InputBtnEvent +# +# Pointer button input event. +# +# @button: Which button this event is for. +# @down: True for key-down and false for key-up events. +# +# Since: 2.0 +## +{ 'type' : 'InputBtnEvent', + 'data' : { 'button' : 'InputButton', + 'down' : 'bool' } } + +## +# @InputMoveEvent +# +# Pointer motion input event. +# +# @axis: Which axis is referenced by @value. +# @value: Pointer position. For absolute coordinates the +# valid range is 0 -> 0x7ffff +# +# Since: 2.0 +## +{ 'type' : 'InputMoveEvent', + 'data' : { 'axis' : 'InputAxis', + 'value' : 'int' } } + +## +# @InputEvent +# +# Input event union. +# +# Since: 2.0 +## +{ 'union' : 'InputEvent', + 'data' : { 'key' : 'InputKeyEvent', + 'btn' : 'InputBtnEvent', + 'rel' : 'InputMoveEvent', + 'abs' : 'InputMoveEvent' } } -- 1.8.3.1