qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] add input-send-event command
Date: Tue, 17 Jun 2014 05:59:53 -0600	[thread overview]
Message-ID: <53A02DB9.5060404@redhat.com> (raw)
In-Reply-To: <20140616231509.GA24935@amt.cnet>

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

On 06/16/2014 05:15 PM, Marcelo Tosatti wrote:
> 
> Which allows specification of absolute/relative, 
> up/down and console parameters.
> 
> Suggested by Gerd Hoffman.
> 
> ---

Needs S-o-B.

>  qapi-schema.json |   18 ++++++++++++++++
>  qmp-commands.hx  |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  ui/input.c       |   31 ++++++++++++++++++++++++++++
>  3 files changed, 108 insertions(+)
> 
> Index: qemu/qapi-schema.json
> ===================================================================
> --- qemu.orig/qapi-schema.json	2014-06-16 20:12:51.049064621 -0300
> +++ qemu/qapi-schema.json	2014-06-16 20:13:42.886920723 -0300
> @@ -4722,3 +4722,21 @@
>                'btn'     : 'InputBtnEvent',
>                'rel'     : 'InputMoveEvent',
>                'abs'     : 'InputMoveEvent' } }
> +
> +##
> +# @input-send-event
> +#
> +# Send input event(s) to guest.
> +#
> +# @console: Which console to send event(s) to.

Is it worth requiring console, or can it be optional and default to the
first available console (usually console 0)?

> +#
> +# @events: List of InputEvent union.
> +#
> +# Returns: Nothing on success.
> +#
> +# Since: 2.1
> +#
> +##
> +{ 'command': 'input-send-event',
> +  'data': { 'console':'int', 'events': [ 'InputEvent' ] } }

See my other mail about possibly extending the InputEvent union (or
creating a new subtype) to add delays into the mix.


> +Example (2):
> +
> +Press ctrl-alt-del.
> +
> +-> { "execute": "input-send-event",
> +     "arguments": { "console": 0, "events": [
> +        { "type": "key", "data" : { "down": true,
> +          "key": {"type": "qcode", "data": "ctrl" } } },
> +        { "type": "key", "data" : { "down": true,
> +          "key": {"type": "qcode", "data": "alt" } } },
> +        { "type": "key", "data" : { "down": true,
> +          "key": {"type": "qcode", "data": "delete" } } } ] } }
> +<- { "return": {} }

Don't you also need to send the key-release events (again, possibly
after a pause), for this to work?


> +        if (!qemu_input_find_handler(1 << event->kind, con)) {
> +            error_setg(errp, "Input handler not found for"
> +                             "event type %s",

Typo: s/forevent/for event/

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2014-06-17 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 23:15 [Qemu-devel] [PATCH] add input-send-event command Marcelo Tosatti
2014-06-17  9:02 ` Gerd Hoffmann
2014-06-17 11:54   ` Eric Blake
2014-06-17 13:41     ` Marcelo Tosatti
2014-06-17 11:59 ` Eric Blake [this message]
2014-06-17 13:46   ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A02DB9.5060404@redhat.com \
    --to=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).