From: Michael Walle <michael@walle.cc>
To: qemu-devel@nongnu.org
Cc: Michael Walle <michael@walle.cc>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 1/4] hid: register kbd hander in init()
Date: Sun, 7 Aug 2011 19:29:17 +0200 [thread overview]
Message-ID: <1312738160-28961-2-git-send-email-michael@walle.cc> (raw)
In-Reply-To: <1312738160-28961-1-git-send-email-michael@walle.cc>
Register the keyboard event handler in hid's init() instead of its reset()
function.
Signed-off-by: Michael Walle <michael@walle.cc>
---
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
next prev parent reply other threads:[~2011-08-07 17:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-07 17:29 [Qemu-devel] [PATCH 0/4] usb/hid: bugfixes, more on usb and hid split Michael Walle
2011-08-07 17:29 ` Michael Walle [this message]
2011-08-07 17:29 ` [Qemu-devel] [PATCH 2/4] hid: introduce hid vmstate macros Michael Walle
2011-08-07 17:29 ` [Qemu-devel] [PATCH 3/4] usb-hid: use hid vmstate macro Michael Walle
2011-08-07 17:29 ` [Qemu-devel] [PATCH 4/4] milkymist-softusb: use hid code directly Michael Walle
2011-08-09 10:35 ` [Qemu-devel] [PATCH 0/4] usb/hid: bugfixes, more on usb and hid split Gerd Hoffmann
-- strict thread matches above, loose matches on Subject: below --
2011-08-09 21:54 [Qemu-devel] [PATCH v2 " Michael Walle
2011-08-09 21:54 ` [Qemu-devel] [PATCH 1/4] hid: register kbd hander in init() Michael Walle
2011-08-09 22:13 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1312738160-28961-2-git-send-email-michael@walle.cc \
--to=michael@walle.cc \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).