* [Qemu-devel] [PATCH] usb-hid: modifiers should generate an event
@ 2011-01-16 18:53 Aurelien Jarno
0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2011-01-16 18:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Aurelien Jarno
When a modifier key is pressed or released, the USB HID keyboard still
answers NAK, unless another key is also pressed or released.
The patch fixes that by calling usb_hid_changed() when a modifier key
is pressed or released.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
hw/usb-hid.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index e8de301..12bf46f 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -460,15 +460,18 @@ static void usb_keyboard_event(void *opaque, int keycode)
case 0xe0:
if (s->modifiers & (1 << 9)) {
s->modifiers ^= 3 << 8;
+ usb_hid_changed(hs);
return;
}
case 0xe1 ... 0xe7:
if (keycode & (1 << 7)) {
s->modifiers &= ~(1 << (hid_code & 0x0f));
+ usb_hid_changed(hs);
return;
}
case 0xe8 ... 0xef:
s->modifiers |= 1 << (hid_code & 0x0f);
+ usb_hid_changed(hs);
return;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-16 18:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-16 18:53 [Qemu-devel] [PATCH] usb-hid: modifiers should generate an event Aurelien Jarno
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).