From bf164c9d903fb939fe0c7b7d7b40202aa6f42d5c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 23 Jun 2011 12:41:19 -0300 Subject: [RHEL6 qemu-kvm PATCH 046/115] usb-hid: modifiers should generate an event RH-Author: Gerd Hoffmann Message-id: <1308832951-8995-44-git-send-email-kraxel@redhat.com> Patchwork-id: 27887 O-Subject: [RHEL-6.2 kvm PATCH 043/115] usb-hid: modifiers should generate an event Bugzilla: 561414 632299 645351 711354 RH-Acked-by: Hans de Goede RH-Acked-by: Paolo Bonzini RH-Acked-by: Jes Sorensen RH-Acked-by: Kevin Wolf From: 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 (cherry picked from commit 373dfc441d55fe6619929fd049ab635bdfca9e62) Signed-off-by: Gerd Hoffmann --- hw/usb-hid.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost --- 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 bc2cd00..f0bcb7d 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -508,15 +508,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.3.2