Use `Key::isMomentary()` in OneShot and ActiveModColor

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1070/head
Michael Richters 3 years ago
parent e6deb09e88
commit f87e130da8
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -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);

@ -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

Loading…
Cancel
Save