[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] hid: register kbd hander in init()
From: |
Michael Walle |
Subject: |
[Qemu-devel] [PATCH 1/4] hid: register kbd hander in init() |
Date: |
Tue, 9 Aug 2011 23:54:52 +0200 |
Register the keyboard event handler in hid's init() instead of its reset()
function.
Signed-off-by: Michael Walle <address@hidden>
---
hw/hid.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/hid.c b/hw/hid.c
index 7b5ef5f..6934f05 100644
--- a/hw/hid.c
+++ b/hw/hid.c
@@ -359,7 +359,6 @@ void hid_reset(HIDState *hs)
{
switch (hs->kind) {
case HID_KEYBOARD:
- qemu_add_kbd_event_handler(hid_keyboard_event, hs);
memset(hs->kbd.keycodes, 0, sizeof(hs->kbd.keycodes));
memset(hs->kbd.key, 0, sizeof(hs->kbd.key));
hs->kbd.keys = 0;
@@ -393,7 +392,9 @@ void hid_init(HIDState *hs, int kind, HIDEventFunc event)
hs->kind = kind;
hs->event = event;
- if (hs->kind == HID_MOUSE) {
+ if (hs->kind == HID_KEYBOARD) {
+ 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");
} else if (hs->kind == HID_TABLET) {
--
1.7.2.5
- [Qemu-devel] [PATCH v2 0/4] usb/hid: bugfixes, more on usb and hid split, Michael Walle, 2011/08/09
- [Qemu-devel] [PATCH 3/4] usb-hid: use hid vmstate macro, Michael Walle, 2011/08/09
- [Qemu-devel] [PATCH 1/4] hid: register kbd hander in init(),
Michael Walle <=
- [Qemu-devel] [PATCH 2/4] hid: introduce hid vmstate macros, Michael Walle, 2011/08/09
- [Qemu-devel] [PATCH 4/4] milkymist-softusb: use hid code directly, Michael Walle, 2011/08/09
- Re: [Qemu-devel] [PATCH v2 0/4] usb/hid: bugfixes, more on usb and hid split, Gerd Hoffmann, 2011/08/10