Skip to contentSkip to conversation

hid: Reset kbd modifiers on reset

PATCH New Alexander Graf 1 participant 1 message Jun 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid: Reset kbd modifiers on reset

When resetting the keyboard, we need to reset not just the pending keystrokes, but also any pending modifiers. Otherwise there's a race when we're getting reset while running an escape sequence (modifier 0x100).

---
 hw/input/hid.c | 1 +
 1 file changed, 1 insertion(+)
hw/input/hid.c +1 -0
index 93887ec..0d049ff 100644
@@ -487,6 +487,7 @@ void hid_reset(HIDState *hs)
         memset(hs->kbd.keycodes, 0, sizeof(hs->kbd.keycodes));
         memset(hs->kbd.key, 0, sizeof(hs->kbd.key));
         hs->kbd.keys = 0;
+        hs->kbd.modifiers = 0;
         break;
     case HID_MOUSE:
     case HID_TABLET:
Signature · 1 line
1.8.5.6