qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 03/15] input: define event types using qapi
Date: Mon, 02 Dec 2013 12:12:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 11/28/2013 07:29 AM, Gerd Hoffmann wrote:
> 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

s/splitted/split/ (yes, one of those stupid English words whose
past-tense spelling is the same as its present tense)

> 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 <address@hidden>
> ---
>  qapi-schema.json | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)

> +
> +
> +###########################################################
> +# WIP - input event data structures
> +# not exposed via qmp yet, needs testing first

But still worth documenting, and adding "Since 2.0" annotations to each
enum and struct.

> +
> +{ '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' } }
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]