From 1f9068ff516558cf977498076f192488f1434545 Mon Sep 17 00:00:00 2001 From: Lisa Ugray Date: Wed, 20 Mar 2019 06:59:12 -0400 Subject: [PATCH] TopsyTurvy: Ensure active state toggles off Previously, if a Topsy key was pressed, then a non-Topsy key was pressed, then the Topsy key was released, we'd return the event consumed before toggling off the active state, leaving Shift keys consumed until a Topsy key got pressed again. Toggle the active state before the early return for Topsy key events. Signed-off-by: Lisa Ugray --- src/kaleidoscope/plugin/TopsyTurvy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kaleidoscope/plugin/TopsyTurvy.cpp b/src/kaleidoscope/plugin/TopsyTurvy.cpp index a7e460e7..07ee12fa 100644 --- a/src/kaleidoscope/plugin/TopsyTurvy.cpp +++ b/src/kaleidoscope/plugin/TopsyTurvy.cpp @@ -42,6 +42,8 @@ EventHandlerResult TopsyTurvy::onKeyswitchEvent(Key &mapped_key, byte row, byte return EventHandlerResult::OK; } + is_active_ = keyIsPressed(key_state); + if (keyToggledOn(key_state)) { last_pressed_position_ = row * COLS + col; } else { @@ -50,7 +52,6 @@ EventHandlerResult TopsyTurvy::onKeyswitchEvent(Key &mapped_key, byte row, byte } } - is_active_ = keyIsPressed(key_state); mapped_key.raw = mapped_key.raw - ranges::TT_FIRST; // invert the shift state