From 71dce27a483744f3ac7186e9113a5ef43a7c2e2f Mon Sep 17 00:00:00 2001 From: "James N. V. Cash" Date: Thu, 2 Nov 2017 15:20:21 -0400 Subject: [PATCH 1/2] Don't cancel one-shot if other key pressed is a modifier --- src/Kaleidoscope/OneShot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kaleidoscope/OneShot.cpp b/src/Kaleidoscope/OneShot.cpp index a625e024..639ec457 100644 --- a/src/Kaleidoscope/OneShot.cpp +++ b/src/Kaleidoscope/OneShot.cpp @@ -151,7 +151,7 @@ Key OneShot::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_st // ordinary key here, with some event - if (keyIsPressed(key_state)) { + if (keyIsPressed(key_state) && !isModifier(mapped_key)) { if (should_mask_on_interrupt_) KeyboardHardware.maskKey(row, col); saveAsPrevious(mapped_key); From c44d80feef9688a88521e2ff3a2260f54c9a0182 Mon Sep 17 00:00:00 2001 From: "James N. V. Cash" Date: Thu, 2 Nov 2017 16:26:58 -0400 Subject: [PATCH 2/2] Call saveAsPrevious even if mod, to avoid triggering sticky key --- src/Kaleidoscope/OneShot.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Kaleidoscope/OneShot.cpp b/src/Kaleidoscope/OneShot.cpp index 639ec457..e62c2592 100644 --- a/src/Kaleidoscope/OneShot.cpp +++ b/src/Kaleidoscope/OneShot.cpp @@ -151,11 +151,13 @@ Key OneShot::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_st // ordinary key here, with some event - if (keyIsPressed(key_state) && !isModifier(mapped_key)) { - if (should_mask_on_interrupt_) - KeyboardHardware.maskKey(row, col); + if (keyIsPressed(key_state)) { saveAsPrevious(mapped_key); - should_cancel_ = true; + if (!isModifier(mapped_key)) { + if (should_mask_on_interrupt_) + KeyboardHardware.maskKey(row, col); + should_cancel_ = true; + } } return mapped_key;