From 209a92b6e07906c2f9f89f74a7497373e6a66cda Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 26 Aug 2018 21:59:42 +0200 Subject: [PATCH] If a non-Topsy key toggles on, disable repeating the Topsy one This is to avoid the case where chording a Topsy and a non-Topsy key would result in both being repeated very fast. This happened because each cycle we sent two reports: one for the Topsy key, one for the others. This didn't allow the host's normal repeating behaviour to kick in, and instead, resulted in both keys being input very fast. Fixes #5. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/TopsyTurvy.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Kaleidoscope/TopsyTurvy.cpp b/src/Kaleidoscope/TopsyTurvy.cpp index a9930924..f616f106 100644 --- a/src/Kaleidoscope/TopsyTurvy.cpp +++ b/src/Kaleidoscope/TopsyTurvy.cpp @@ -34,9 +34,13 @@ EventHandlerResult TopsyTurvy::onKeyswitchEvent(Key &mapped_key, byte row, byte if (mapped_key.raw == Key_RightShift.raw) bitWrite(mod_state_, 1, keyIsPressed(key_state)); + if (mapped_key < ranges::TT_FIRST || mapped_key > ranges::TT_LAST) { + if (keyToggledOn(key_state)) { + last_pressed_position_ = row * COLS + col; + } - if (mapped_key < ranges::TT_FIRST || mapped_key > ranges::TT_LAST) return EventHandlerResult::OK; + } if (keyToggledOn(key_state)) { last_pressed_position_ = row * COLS + col;