From patchwork Wed Jan 22 16:20:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 313290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1C8802C009B for ; Thu, 23 Jan 2014 03:22:02 +1100 (EST) Received: from localhost ([::1]:36041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W60Yx-0006bV-Oq for incoming@patchwork.ozlabs.org; Wed, 22 Jan 2014 11:21:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W60Y6-0006Wi-LK for qemu-devel@nongnu.org; Wed, 22 Jan 2014 11:21:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W60Xx-0005o8-PM for qemu-devel@nongnu.org; Wed, 22 Jan 2014 11:21:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W60Xx-0005ni-G7 for qemu-devel@nongnu.org; Wed, 22 Jan 2014 11:20:57 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0MGKuAA011809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 Jan 2014 11:20:56 -0500 Received: from nilsson.home.kraxel.org (vpn1-5-23.ams2.redhat.com [10.36.5.23]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0MGKtm6013251; Wed, 22 Jan 2014 11:20:56 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 9ADD580EDE; Wed, 22 Jan 2014 17:20:53 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 22 Jan 2014 17:20:11 +0100 Message-Id: <1390407647-8659-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1390407647-8659-1-git-send-email-kraxel@redhat.com> References: <1390407647-8659-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Markus Armbruster , Gerd Hoffmann , Luiz Capitulino Subject: [Qemu-devel] [PATCH v2 06/42] input: qapi: define event types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 f27c48a..38ffc88 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4270,3 +4270,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' } }