qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/2] input: introduce keyboard handler list


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 2/2] input: introduce keyboard handler list
Date: Mon, 11 Mar 2013 13:46:07 +0000

On 8 March 2013 14:22, Gerd Hoffmann <address@hidden> wrote:
> Add a linked list of keyboard handlers.  Added handlers will go
> to the head of the list.  Removed handlers will be zapped from
> the list.  The head of the list will be used for events.
>
> This fixes the keyboard-dead-after-usb-kbd-unplug issue, key events
> will be re-routed to the ps/2 kbd instead of being discarded.

Ah, multiple keyboard handlers. I've actually been carrying
something similar in the qemu-linaro tree for ages, inherited
from Nokia for n900 support:
http://git.linaro.org/gitweb?p=qemu/qemu-linaro.git;a=commitdiff;h=6be1ca3d2b79118fce871aa8454336502b3a5ca4

The major difference is that where this code sends key events
to the first handler only, the Nokia patch sends events to
all keys, because the use case it's trying to deal with is
"some keys should go to one device and some to another"
(for example, most keys go to a usb keyboard but F-keys
are treated as being like some of the hardware buttons on
the phone, and they go to a different device in the model).

Maybe we could deal with this by having kbd_put_keycode()
send the event to every register keyboard until one of
them says it has handled it [ie have the put_kbd callback
return a handled/not-handled return]. That would still
leave the issue that you need to make sure that keyboard
handlers get called in the right order (perhaps a priority
thing on registering?)

Anyway, no objection to this patch (and I'm certainly not
trying to say you should fix my problems in this patch),
I just thought I'd mention this other usecase for multiple
keyboards while it was in my head.

thanks
-- PMM



reply via email to

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