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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] monitor: intervally send down events to guest in hold time
Date: Mon, 22 Apr 2013 10:25:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/22/2013 01:32 AM, 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?

I didn't know that there is some bare metal hardware that sends more
than one event.  As long as you are matching bare metal behavior, then I
will be happy; but I still wonder if hard-coding repeat rates instead of
making it configurable is the best choice.

> 
> # 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.

Nice tool that I had not used before.  Thanks for pointing it out to me.

> 
> 
> 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?
> 
>> if the console displays
>> multiple copies of the character being typed, it is because the console
>> does the repeats itself.
> 
>> If the user wants multiple down and up events,
>> they should send multiple events, not rely on one command to send
>> multiple presses.

So now that I have more information, I'm okay with sending multiple down
events and one up event for a long hold time (if we are emulating
hardware that does the same), and still making the user call send-key
multiple times if they want multiple up events.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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