From b1953f07a20f0122a95d99fce1f0f77616290676 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 6 Aug 2017 22:58:08 +0200 Subject: [PATCH] OSL: Flip the `should_mask_on_interrupt_` bit on OSL release, not press When we hold the OSL key, we do not need to mask out interruptors, because they are not going to interrupt. As such, flip the `should_mask_on_interrupt_` bit on OSL key release. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/OneShot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Kaleidoscope/OneShot.cpp b/src/Kaleidoscope/OneShot.cpp index bc742305..743de1d7 100644 --- a/src/Kaleidoscope/OneShot.cpp +++ b/src/Kaleidoscope/OneShot.cpp @@ -93,16 +93,16 @@ Key OneShot::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_st if (keyToggledOff(key_state)) { clearPressed(idx); + + if (mapped_key >= ranges::OSL_FIRST && mapped_key <= ranges::OSL_LAST) { + should_mask_on_interrupt_ = true; + } } else if (keyToggledOn(key_state)) { start_time_ = millis(); setPressed(idx); setOneShot(idx); saveAsPrevious(mapped_key); - if (mapped_key >= ranges::OSL_FIRST && mapped_key <= ranges::OSL_LAST) { - should_mask_on_interrupt_ = true; - } - activateOneShot(idx); }