All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Amos Kong <akong@redhat.com>, kraxel@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time
Date: Mon, 22 Apr 2013 08:43:50 -0400	[thread overview]
Message-ID: <20130422084350.17b2941b@redhat.com> (raw)
In-Reply-To: <517503E0.1080906@redhat.com>

On Mon, 22 Apr 2013 11:33:20 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Il 22/04/2013 10:09, Amos Kong ha scritto:
> > On Mon, Apr 22, 2013 at 03:32:52PM +0800, Amos Kong wrote:
> >> On Sat, Apr 20, 2013 at 10:06:28AM -0600, Eric Blake wrote:
> >>> On 04/18/2013 10:44 PM, Amos Kong wrote:
> >>>> (qemu) sendkey a 1000
> >>>>
> >>>> Current design is that qemu only send one down event to guest,
> >>>> and delay sometime, then send one up event. In this case, only
> >>>> key can be identified by guest.
> >>>>
> >>>> This patch changed qemu to intervally send down events to guest
> >>>> in the hold time, the interval is 100ms.
> >>>
> >>> I don't like this.
> >>
> >>> When you hold a key for a long time on bare metal,
> >>> there is only one down and one up event;
> >>
> >> Really? I do check events by 'showkey', the output of showkey is not the
> >> events sent from keyboard?
> >>
> >> # showkey -s (show keys' scancode)
> >> I can always see many down scancodes, and one up scancode.
> >> It's same when I disable / enable auto-repeat mode in system.
> >>
> >> In the real host / vnc guest/ sdl guest, hold one key, many down
> >> events can be checked by showkey.
> >  
> > # watch cat /proc/interrupts
> >           CPU0       CPU1       CPU2       CPU3
> >  1:       1692      40309       1462       1795   IO-APIC-edge  i8042
> > 
> > hit a botton without long-time holding, interrupt count increased 2.
> > hit a botton with long-time holding, interrupt count increased a lot (more than 2)
> 
> You're right.  The typematic delay/rate is implemented within the i8042
> keyboard microcontroller (QEMU does not implement that register).
> 
> It is possible that software ignores interrupts for a key that is
> already down, and reimplements autorepeat in software, but your patch is
> correct.

But isn't this patch the equivalent of repeatedly pressing and releasing a
key? Shouldn't this be implemented at a lower-level layer like the input
subsystem?

Say, the input subsystem detects a key is being hold and asks the keyboard
emulation driver to keep sending interrupts for that key like Amos described?

  reply	other threads:[~2013-04-22 12:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  4:44 [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time Amos Kong
2013-04-20 16:06 ` Eric Blake
2013-04-22  7:32   ` Amos Kong
2013-04-22  8:09     ` Amos Kong
2013-04-22  9:33       ` Paolo Bonzini
2013-04-22 12:43         ` Luiz Capitulino [this message]
2013-04-22 13:03           ` Paolo Bonzini
2013-04-22 13:35             ` Gerd Hoffmann
2013-04-22 14:32               ` Paolo Bonzini
2013-04-22 15:20                 ` Gerd Hoffmann
2013-04-22 15:41                   ` Paolo Bonzini
2013-04-22 14:02             ` Anthony Liguori
2013-04-22 14:22               ` Luiz Capitulino
2013-04-23  2:24               ` Amos Kong
2013-04-22  8:25     ` [Qemu-devel] [PATCH] ui/input.c: replace magic numbers by macros Amos Kong
2013-04-22 16:25     ` [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time Eric Blake
2013-05-14 12:42 ` Laszlo Ersek
2013-05-14 14:55   ` Anthony Liguori
2013-05-15  8:13     ` Amos Kong

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=20130422084350.17b2941b@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=akong@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@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.