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 095739cc8e..597a05f01b 100644 --- a/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp +++ b/plugins/Kaleidoscope-USB-Quirks/src/kaleidoscope/plugin/USB-Quirks.cpp @@ -28,12 +28,8 @@ namespace kaleidoscope { namespace plugin { void USBQuirks::toggleKeyboardProtocol() { - uint8_t new_protocol = !Runtime.hid().keyboard().getProtocol(); - - Runtime.detachFromHost(); - Runtime.hid().keyboard().setDefaultProtocol(new_protocol); - delay(1000); - Runtime.attachToHost(); + // Do nothing, because the old behavior might cause HID-aware hosts to + // receive no input, now that we mark the Boot Keyboard report as padding } } // namespace plugin diff --git a/src/kaleidoscope/driver/hid/base/Keyboard.h b/src/kaleidoscope/driver/hid/base/Keyboard.h index 47dcf4e93a..87347e50d7 100644 --- a/src/kaleidoscope/driver/hid/base/Keyboard.h +++ b/src/kaleidoscope/driver/hid/base/Keyboard.h @@ -149,17 +149,15 @@ class Keyboard { } void sendReport() __attribute__((noinline)) { - if (boot_keyboard_.getProtocol() == HID_BOOT_PROTOCOL) { - boot_keyboard_.sendReport(); - return; + boot_keyboard_.sendReport(); + if (boot_keyboard_.getProtocol() != HID_BOOT_PROTOCOL) { + nkro_keyboard_.sendReport(); + consumer_control_.sendReport(); } - nkro_keyboard_.sendReport(); - consumer_control_.sendReport(); } void releaseAllKeys() __attribute__((noinline)) { - if (boot_keyboard_.getProtocol() == HID_BOOT_PROTOCOL) { - boot_keyboard_.releaseAll(); - } else { + boot_keyboard_.releaseAll(); + if (boot_keyboard_.getProtocol() != HID_BOOT_PROTOCOL) { nkro_keyboard_.releaseAll(); consumer_control_.releaseAll(); } @@ -204,21 +202,17 @@ class Keyboard { // pressRawKey takes a Key object and calles KeyboardioHID's ".press" method // with its keycode. It does no processing of any flags or modifiers on the key void pressRawKey(Key pressed_key) { - if (boot_keyboard_.getProtocol() == HID_BOOT_PROTOCOL) { - boot_keyboard_.press(pressed_key.getKeyCode()); - return; + boot_keyboard_.press(pressed_key.getKeyCode()); + if (boot_keyboard_.getProtocol() != HID_BOOT_PROTOCOL) { + nkro_keyboard_.press(pressed_key.getKeyCode()); } - - nkro_keyboard_.press(pressed_key.getKeyCode()); } void releaseRawKey(Key released_key) { - if (boot_keyboard_.getProtocol() == HID_BOOT_PROTOCOL) { - boot_keyboard_.release(released_key.getKeyCode()); - return; + boot_keyboard_.release(released_key.getKeyCode()); + if (boot_keyboard_.getProtocol() != HID_BOOT_PROTOCOL) { + nkro_keyboard_.release(released_key.getKeyCode()); } - - nkro_keyboard_.release(released_key.getKeyCode()); } void releaseKey(Key released_key) { diff --git a/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h b/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h index 5da9b72165..a286f03db0 100644 --- a/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h +++ b/src/kaleidoscope/driver/hid/keyboardio/Keyboard.h @@ -23,6 +23,11 @@ // From Kaleidoscope: #include "kaleidoscope/driver/hid/base/Keyboard.h" // for Keyboard, KeyboardProps +#if !BOOTKB_AS_PADDING +#error "This version of Kaleidoscope requires KeyboardioHID with BOOTKB_AS_PADDING" +#error "Please update your KeyboardioHID" +#endif + namespace kaleidoscope { namespace driver { namespace hid {