From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLAOf-0002uY-4J for qemu-devel@nongnu.org; Wed, 05 Mar 2014 06:54:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLAOY-0002BA-Kh for qemu-devel@nongnu.org; Wed, 05 Mar 2014 06:54:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLAOY-0002Am-Av for qemu-devel@nongnu.org; Wed, 05 Mar 2014 06:53:54 -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 s25Brqnf020172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Mar 2014 06:53:52 -0500 From: Gerd Hoffmann Date: Wed, 5 Mar 2014 12:53:05 +0100 Message-Id: <1394020420-17576-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1394020420-17576-1-git-send-email-kraxel@redhat.com> References: <1394020420-17576-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL v4 03/38] 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 a lot 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 split 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 Reviewed-by: Eric Blake --- qapi-schema.json | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 193e7e4..9d7d7a8 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4566,3 +4566,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