From 36c54dfb1d4c0abf095b4ed0b9e45219bc903900 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Sat, 2 Dec 2023 20:18:23 -0600 Subject: [PATCH] release keys --- .../src/kaleidoscope/plugin/USB-Quirks.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp b/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp index 334e854410..fdd0eb6384 100644 --- a/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp +++ b/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp @@ -60,6 +60,13 @@ void USBQuirks::toggleKeyboardProtocol() { ::LEDControl.setCrgbAt(key_addr, CRGB(0, 0, 255)); } Runtime.device().syncLeds(); + /* + * Release keys, because after detach, Windows 10 remembers keys that + * were pressed (from the MagicCombo that activated this function). + */ + Runtime.hid().keyboard().releaseAllKeys(); + Runtime.hid().keyboard().sendReport(); + delay(10); Runtime.detachFromHost(); Runtime.hid().keyboard().setBootOnly(new_bootonly); delay(1000);