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

On Tue, Jun 17, 2014 at 05:59:53AM -0600, Eric Blake wrote:
> 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)?

It is required. Would rather not allow the user to send a command
to an console without knowing what console that is.

> > +#
> > +# @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?

No, key signals on "down".

> > +        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/

Yes there is another missing space, thanks.

      reply	other threads:[~2014-06-17 13:46 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
2014-06-17 13:46   ` Marcelo Tosatti [this message]

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=20140617134609.GB16748@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@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).