All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	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: Sat, 27 Sep 2014 11:29:09 +0800	[thread overview]
Message-ID: <20140927032909.GA3029@air> (raw)
In-Reply-To: <1411730645.865.8.camel@nilsson.home.kraxel.org>

On Fri, Sep 26, 2014 at 01:24:05PM +0200, Gerd Hoffmann wrote:
> On Fr, 2014-09-26 at 18:53 +0800, 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.
> 
> To type 'root' you should use
> 
> sendkey r
> sendkey o
> sendkey o
> sendkey t
> 
> Multiple keys in sendkey is meant for multiple keys pressed at the same
> time, i.e. ctrl-alt-del, not for sending key sequences and typing words.
> 
> > People want to panic windows by sending Ctrl-Scrool-Scrool
> > http://msdn.microsoft.com/en-us/library/windows/hardware/ff545499(v=vs.85).aspx
> > But current events order doesn't work.
> 
> sendkey Ctrl-Scroll
> sendkey Ctrl-Scroll
> 
> > In physical keyboard. We can prese Ctrl first, then press & release
> > Scroll twice, then release Ctrl. It's very common behavior.
> 
> In most cases it doesn't matter whenever you release the modifier key or
> not.  The windows panic hotkey might be the exception from the rule
> though.

It doesn't matter, so users might release the modifier key or not.
we should make both works

1)
sendkey Ctrl-Scroll
sendkey Ctrl-Scroll

2)
sendkey Ctrl-Scroll-Scroll
 
> > 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)
> 
> sendkey doesn't cover that use case indeed.

original sendkey didn't cover it, but my change isn't added a split
feature, but try to adapt native behavior by a little change.
It doesn't effect original right behavior, but process repeated case
in native way.
 
> /me wonders what happened to the input-send-event patch from marcelo,
> see http://patchwork.ozlabs.org/patch/360649/
> 
> According to patchwork I've picked it up.  But it is neither upstream
> nor in my local input branch.  And I can't remember what happened :(
> Marcelo, any clue?  Maybe I should just re-queue it ...
> 
> The input-send-event gives you fine-grained control about the exact
> input event sequence and it can handle your use case without problems.
> 
> cheers,
>   Gerd

-- 
			Amos.

  parent reply	other threads:[~2014-09-27  3:29 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 [this message]
2014-09-29  9:09         ` Gerd Hoffmann
2014-10-29  7:12           ` Amos Kong
2014-09-26 14:04     ` Eric Blake

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=20140927032909.GA3029@air \
    --to=akong@redhat.com \
    --cc=aliguori@amazon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.