]> Git Repo - qemu.git/commitdiff
usb-hid: modifiers should generate an event
authorAurelien Jarno <[email protected]>
Mon, 17 Jan 2011 18:29:34 +0000 (19:29 +0100)
committerAurelien Jarno <[email protected]>
Thu, 20 Jan 2011 11:37:20 +0000 (12:37 +0100)
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 <[email protected]>
hw/usb-hid.c

index e8de301a13c099625a22a7316eb489f8cad0e143..12bf46fa7e92b97a608de8ccfa92fad47c2e5aec 100644 (file)
@@ -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;
     }
 
This page took 0.02806 seconds and 4 git commands to generate.