diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2011-01-17 19:29:34 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-01-20 12:37:20 +0100 |
commit | 373dfc441d55fe6619929fd049ab635bdfca9e62 (patch) | |
tree | 60e2ba5ddc9a50844c9e42e888741bb5464c95d1 /hw/usb-hid.c | |
parent | de4af5f7928bb68d4e2b576598c245a256fcabbb (diff) | |
download | qemu-373dfc441d55fe6619929fd049ab635bdfca9e62.zip qemu-373dfc441d55fe6619929fd049ab635bdfca9e62.tar.gz qemu-373dfc441d55fe6619929fd049ab635bdfca9e62.tar.bz2 |
usb-hid: modifiers should generate an event
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>
Diffstat (limited to 'hw/usb-hid.c')
-rw-r--r-- | 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; } |