diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-04-24 12:08:38 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-24 11:50:18 -0500 |
commit | 5a37532d0897de488c35ab2db6d86647bd2a1b6f (patch) | |
tree | 13c6185efc40487fef39999ba0055120ac739aac /hw/input | |
parent | 72711efb58c13e28c89813490120b32947a2d719 (diff) | |
download | qemu-5a37532d0897de488c35ab2db6d86647bd2a1b6f.zip qemu-5a37532d0897de488c35ab2db6d86647bd2a1b6f.tar.gz qemu-5a37532d0897de488c35ab2db6d86647bd2a1b6f.tar.bz2 |
input: introduce keyboard handler list
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.
[ v2: fix cut+paste bug found my Markus ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1366798118-3248-3-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/input')
-rw-r--r-- | hw/input/hid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/input/hid.c b/hw/input/hid.c index 5fbde98..14b3125 100644 --- a/hw/input/hid.c +++ b/hw/input/hid.c @@ -415,7 +415,7 @@ void hid_free(HIDState *hs) { switch (hs->kind) { case HID_KEYBOARD: - qemu_remove_kbd_event_handler(); + qemu_remove_kbd_event_handler(hs->kbd.eh_entry); break; case HID_MOUSE: case HID_TABLET: @@ -431,7 +431,7 @@ void hid_init(HIDState *hs, int kind, HIDEventFunc event) hs->event = event; if (hs->kind == HID_KEYBOARD) { - qemu_add_kbd_event_handler(hid_keyboard_event, hs); + hs->kbd.eh_entry = qemu_add_kbd_event_handler(hid_keyboard_event, hs); } else if (hs->kind == HID_MOUSE) { hs->ptr.eh_entry = qemu_add_mouse_event_handler(hid_pointer_event, hs, 0, "QEMU HID Mouse"); |