From f87e130da83a9a53f4235098fe34ddaf8fa256c6 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Thu, 17 Jun 2021 18:19:38 -0500 Subject: [PATCH] Use `Key::isMomentary()` in OneShot and ActiveModColor Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/LED-ActiveModColor.cpp | 3 +-- .../Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.cpp b/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.cpp index 5675224c..5931adca 100644 --- a/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.cpp +++ b/plugins/Kaleidoscope-LED-ActiveModColor/src/kaleidoscope/plugin/LED-ActiveModColor.cpp @@ -52,8 +52,7 @@ EventHandlerResult ActiveModColorEffect::onKeyEvent(KeyEvent &event) { // If a key toggles on, we check its value. If it's a OneShot key, it will // get highlighted. Conditionally (if `highlight_normal_modifiers_` is set), // we also highlight modifier and layer-shift keys. - if (event.key.isKeyboardModifier() || - event.key.isLayerShift() || + if (event.key.isMomentary() || ::OneShot.isOneShotKey(event.key) || ::OneShot.isActive(event.addr)) { mod_key_bits_.set(event.addr); diff --git a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp index 95bc29b0..108efc7e 100644 --- a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp +++ b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp @@ -218,8 +218,7 @@ EventHandlerResult OneShot::onKeyEvent(KeyEvent &event) { (auto_layers_ && event.key.isLayerShift())) { temp_addrs_.set(event.addr); start_time_ = Runtime.millisAtCycleStart(); - } else if (!event.key.isKeyboardModifier() && - !event.key.isLayerShift()) { + } else if (!event.key.isMomentary()) { // Only trigger release of temporary one-shot keys if the pressed key is // neither a modifier nor a layer shift. We need the actual release of // those keys to happen after the current event is finished, however, so