qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] monitor: intervally send down events to guest i


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time
Date: Mon, 22 Apr 2013 16:09:35 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

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)


http://www.oocities.org/timessquare/2795/Files/keyboard.txt
"""
 If someone had just pressed the ESC key for instance, the port will
 show a value of 1 (1 is the ESC key's scan code). If they hold their finger
 on the button the keyboard will _keep_ generating interrupt 9's and each
 time the port will still show a value of 1. When the person releases the key
 a final interrupt will be generated and the port will return 129 (1 + 128,
 since the high bit will be set indicating the person has released the key).
"""

Hi Eric, it seems my change is same as real metal, please tell me if something
is wrong, Thanks.

 
> http://msdn.microsoft.com/en-us/library/windows/desktop/gg153546(v=vs.85).aspx
> """
> If you hold down a key long enough to start the keyboard's repeat
> feature, the system sends multiple key-down messages, followed by a
> single key-up message. """
> 
> key-down messages == key-down events?

-- 
                        Amos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]