From 99abfdc3dcbfcfdacbb86695c3a047e61ed47dcb Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 18 Dec 2018 14:18:16 -0600 Subject: [PATCH] Added some descriptive comments regarding Qukeys release delay Signed-off-by: Michael Richters --- src/kaleidoscope/plugin/Qukeys.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kaleidoscope/plugin/Qukeys.cpp b/src/kaleidoscope/plugin/Qukeys.cpp index dbdbc7bf..a0f7c8a4 100644 --- a/src/kaleidoscope/plugin/Qukeys.cpp +++ b/src/kaleidoscope/plugin/Qukeys.cpp @@ -154,6 +154,7 @@ bool Qukeys::flushKey(bool qukey_state, uint8_t keyswitch_state) { // the queue, delay this key's release event: if (release_delay_ > 0 && key_queue_length_ > 1) { key_queue_[0].start_time = millis() + QUKEYS_RELEASE_DELAY_OFFSET; + // Store the alternate keycode to send the toggle-off event later, if appropriate: if (is_dual_use) { delayed_qukey_keycode_ = getDualUseAlternateKey(keycode); } else { // is_qukey @@ -345,6 +346,8 @@ EventHandlerResult Qukeys::beforeReportingState() { setQukeyState(key_queue_[0].addr, QUKEY_STATE_PRIMARY); flushKey(QUKEY_STATE_PRIMARY, WAS_PRESSED); flushQueue(); + // If the release delay has timed out, we need to prevent the wrong toggle-off + // event from being sent: delayed_qukey_keycode_ = Key_NoKey; } return EventHandlerResult::OK;