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 // 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), // get highlighted. Conditionally (if `highlight_normal_modifiers_` is set),
// we also highlight modifier and layer-shift keys. // we also highlight modifier and layer-shift keys.
if (event.key.isKeyboardModifier() || if (event.key.isMomentary() ||
event.key.isLayerShift() ||
::OneShot.isOneShotKey(event.key) || ::OneShot.isOneShotKey(event.key) ||
::OneShot.isActive(event.addr)) { ::OneShot.isActive(event.addr)) {
mod_key_bits_.set(event.addr); mod_key_bits_.set(event.addr);

@ -218,8 +218,7 @@ EventHandlerResult OneShot::onKeyEvent(KeyEvent &event) {
(auto_layers_ && event.key.isLayerShift())) { (auto_layers_ && event.key.isLayerShift())) {
temp_addrs_.set(event.addr); temp_addrs_.set(event.addr);
start_time_ = Runtime.millisAtCycleStart(); start_time_ = Runtime.millisAtCycleStart();
} else if (!event.key.isKeyboardModifier() && } else if (!event.key.isMomentary()) {
!event.key.isLayerShift()) {
// Only trigger release of temporary one-shot keys if the pressed key is // 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 // 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 // those keys to happen after the current event is finished, however, so

Loading…
Cancel
Save