From patchwork Fri Feb 28 14:06:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 325209 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 01DB02C00A7 for ; Sat, 1 Mar 2014 01:12:57 +1100 (EST) Received: from localhost ([::1]:51308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJOBK-00084t-6l for incoming@patchwork.ozlabs.org; Fri, 28 Feb 2014 09:12:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJO5f-0001cf-Uv for qemu-devel@nongnu.org; Fri, 28 Feb 2014 09:07:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJO5Y-0003f4-Cb for qemu-devel@nongnu.org; Fri, 28 Feb 2014 09:07:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJO5Y-0003dW-3f for qemu-devel@nongnu.org; Fri, 28 Feb 2014 09:06:56 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1SE6sHF017734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Feb 2014 09:06:55 -0500 Received: from nilsson.home.kraxel.org (vpn1-5-124.ams2.redhat.com [10.36.5.124]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1SE6rCF004448; Fri, 28 Feb 2014 09:06:54 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id C7813805AA; Fri, 28 Feb 2014 15:06:52 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 28 Feb 2014 15:06:14 +0100 Message-Id: <1393596409-28934-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1393596409-28934-1-git-send-email-kraxel@redhat.com> References: <1393596409-28934-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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] [PULL 03/38] 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 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 ac8ad24..0c6090e 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4518,3 +4518,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' } }