qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Michael Goldish <mgoldish@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] Monitor: Convert do_sendkey() to QObject, QError
Date: Thu, 22 Jul 2010 11:36:09 -0300	[thread overview]
Message-ID: <20100722113609.74fcc363@redhat.com> (raw)
In-Reply-To: <20100722140327.GH992@redhat.com>

On Thu, 22 Jul 2010 15:03:27 +0100
"Daniel P. Berrange" <berrange@redhat.com> wrote:

> On Thu, Jul 22, 2010 at 10:50:00AM -0300, Luiz Capitulino wrote:
> > On Thu, 22 Jul 2010 14:45:35 +0100
> > "Daniel P. Berrange" <berrange@redhat.com> wrote:
> > 
> > > On Thu, Jul 22, 2010 at 10:28:39AM -0300, Luiz Capitulino wrote:
> > > > On Wed, 21 Jul 2010 20:06:56 +0100
> > > > "Daniel P. Berrange" <berrange@redhat.com> wrote:
> > > > 
> > > > > On Wed, Jul 21, 2010 at 03:44:14PM -0300, Luiz Capitulino wrote:
> > > > > > Another related issue is that, this probably should an async handler. But
> > > > > > as we don't have the proper infrastructure yet, I'm ok with having this in
> > > > > > its current form.
> > > > > > 
> > > > > > > +- "hold_time": duration in milliseconds to hold the keys down (json-int, optional, default=100)
> > > > > 
> > > > > Having 'hold-time' which applies to the full list of keys is limiting
> > > > > the flexibility of apps. eg, it means you can only do
> > > > > 
> > > > >    down ctrl
> > > > >    down alt
> > > > >    down f1
> > > > >    wait 100ms
> > > > >    up ctrl
> > > > >    up alt
> > > > >    up f1
> > > > > 
> > > > > Again I can see why the impl works this way currently, because it is
> > > > > clearly a nicer option for humans. For a machine protocol though it
> > > > > seems sub-optimal. What if app needed more flexibility over ordering
> > > > > of press+release events eg to release in a different order
> > > > > 
> > > > >    down ctrl
> > > > >    down alt
> > > > >    down f1
> > > > >    wait 100ms
> > > > >    up f1
> > > > >    up ctrl
> > > > >    up alt
> > > > > 
> > > > > Should we just follow VNC and explicitly have a up/down flag in
> > > > > the protocol & let press & release events be sent separately.
> > > > > 
> > > > >   { "execute": "sendkey", "arguments":  { "keycode": 0x31, "down": true } }
> > > > > 
> > > > > We could allow multiple keycodes in one message
> > > > > 
> > > > >   { "execute": "sendkey", "arguments":  { "keycodes": [ 0x31, 0x32 ], "down": true } }
> > > > > 
> > > > > but its not really adding critical functionality that can't be got by
> > > > > sending a sequence of sendkey commands in a row.
> > > > 
> > > > Hm, looks good to me, but then the hold time would be the time period
> > > > between the down/up commands. This won't be reliable in case the client
> > > > wants to exactly wait 100ms, as we can have network latency, for example.
> > > > 
> > > > Isn't this a problem? I believe VNC doesn't have this feature, right?
> > > 
> > > Correct, VNC just sends each individual press / release event as a separate
> > > message, so you can have network delay effects there too.
> > > 
> > > If we needed to support precise delays safe from network delay for some
> > > simulation needs, then you'd probably need a more complex structure
> > > where you can provide a whole sequence of operations. And why stop at
> > > keys, including mouse movement & buttons to.
> > > 
> > >    { "execute": "sendinput", "arguments":  { 
> > >        "sequence" : [
> > >           { "event": "keypress", "keycode": 0x31 },
> > >           { "event": "keypress", "keycode": 0x75 },
> > >           { "event": "wait", "delay": 100 },
> > >           { "event": "mousepress", "button": 1 },
> > >           { "event": "mousemove", "xdelta": 1, "ydelta": 1 },
> > >           { "event": "keyrelease", "keycode": 0x31 },
> > >           { "event": "wait", "delay": 100 },
> > >           { "event": "keyrelease", "keycode": 0x75 },
> > >           { "event": "mousepos", "x": 102, "y": 102 },
> > >        ] 
> > >    } }
> > > 
> > > This is getting kind of advanced now. Whether we need this vs the simpler
> > > sendkey, mouse_move, etc command comes down to whether we need ability to
> > > set precise delays between events.  We could stick with the individual
> > > simple commands & add a advanced one alter  
> > 
> > Yeah, agreed and I think the current design (ie. hold_time) is simpler.
> 
> When I said stick with simpler sendkey, I mean the style I outlined
> without any hold time at all
> 
> > > > >   { "execute": "sendkey", "arguments":  { "keycode": 0x31, "down": true } }
> 
> If its good enough for VNC & SPICE, it should be good enough for most
> monitor users, even more so since QMP communication is usually over a
> low latency UNIX domain socket. I think hold time is a flawed concept
> as currently provide since it prevents up/down interleaving by sending
> a sequence of QMP commands. 

I don't want to suck the QMP interface because of that, but the problem
here is how to maintain the user monitor's current behavior.

The best option is to wait for the user monitor/QMP split. This way the
hold time could be a feature of the user monitor command only.

Or, we could add a new command. But this would just be a workaround..

  reply	other threads:[~2010-07-22 14:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 12:43 [Qemu-devel] [PATCH] Monitor: Convert do_sendkey() to QObject, QError Michael Goldish
2010-07-21 18:44 ` Luiz Capitulino
2010-07-21 19:06   ` Daniel P. Berrange
2010-07-22 13:28     ` Luiz Capitulino
2010-07-22 13:45       ` Daniel P. Berrange
2010-07-22 13:50         ` Luiz Capitulino
2010-07-22 14:03           ` Daniel P. Berrange
2010-07-22 14:36             ` Luiz Capitulino [this message]
2010-07-21 20:30   ` Michael Goldish
2010-07-22 13:39     ` Luiz Capitulino
2010-07-22 21:17   ` Artyom Tarasenko
2010-07-22 22:27     ` Luiz Capitulino

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=20100722113609.74fcc363@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mgoldish@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).