qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Amos Kong <akong@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, aliguori@amazon.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] ui/input: fix event emitting of repeated combined keys
Date: Fri, 26 Sep 2014 08:04:45 -0600	[thread overview]
Message-ID: <5425727D.40108@redhat.com> (raw)
In-Reply-To: <20140926105320.GA11893@air.nay.redhat.com>

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

On 09/26/2014 04:53 AM, Amos Kong wrote:
> On Fri, Sep 26, 2014 at 12:36:50PM +0200, Gerd Hoffmann wrote:
>> On Fr, 2014-09-26 at 18:23 +0800, Amos Kong wrote:
>>> Currently we emit press events of combined keys first, then emit
>>> release events by reverse order. But it doesn't match with physical
>>> keyboard if the keys contain continued & repeated keys.
>>>
>>> For example, (qemu) sendkey a-b-b
>>
>> Hmm, somehow I don't feel like building too much magic into this.
>> If you want send Ctrl-somekey twice just use two sendkey commands ...
> 
> 
> Before this patch, If 'sendkey r-o-o-t', only 'rot' can be inputted.

sendkey with multiple keys is designed for shift modifiers, NOT for
repeated keys.  'sendkey r-o-o-t' makes no sense; it is the equivalent
of mashing down the 'r', 'o', and 't' keys at once.  To send four
separate key events, you need to do 'sendkey r; sendkey o; sendkey o;
sendkey t'.  (Or libvirt should learn some syntactic sugar so you could
do 'sendkey r -- o -- o -- t' and sequence it automatically).

I don't think this patch is worth the effort.

> 
> People want to panic windows by sending Ctrl-Scrool-Scrool

s/Scrool/Scroll/

> http://msdn.microsoft.com/en-us/library/windows/hardware/ff545499(v=vs.85).aspx
> But current events order doesn't work.
> 
> In physical keyboard. We can prese Ctrl first, then press & release
> Scroll twice, then release Ctrl. It's very common behavior.
> 

Hmm.  This almost argues that we need a way to send a press without a
release, or a release without a press, rather than trying to make
'sendkey Ctrl-Scroll-Scroll' emulate double scroll pushes all while ctrl
is still held down.  But this example is MUCH more realistic than
'r-o-o-t', so maybe there is merit to your patch after all.

> So this fix just reference the physical implement, if you want to
> input same key twice, you have to release it before second pressing.
> (here we ignore the auto-repeat feature)
> 


-- 
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: 539 bytes --]

      parent reply	other threads:[~2014-09-26 14:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 10:23 [Qemu-devel] [PATCH v2] ui/input: fix event emitting of repeated combined keys Amos Kong
2014-09-26 10:36 ` Gerd Hoffmann
2014-09-26 10:53   ` Amos Kong
2014-09-26 11:24     ` Gerd Hoffmann
2014-09-26 15:15       ` Marcelo Tosatti
2014-09-29  8:59         ` Gerd Hoffmann
2014-09-27  3:29       ` Amos Kong
2014-09-29  9:09         ` Gerd Hoffmann
2014-10-29  7:12           ` Amos Kong
2014-09-26 14:04     ` Eric Blake [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=5425727D.40108@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=aliguori@amazon.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).