Skip to contentSkip to conversation

usb-hid: modifiers should generate an event

PATCH New Aurelien Jarno 1 participant 1 message Jan 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 hw/usb-hid.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
hw/usb-hid.c +3 -0
index e8de301..12bf46f 100644
@@ -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;
     }
 
Signature · 1 line
1.7.2.3