Make ActiveModColor work if registered ahead of OneShot

If `ActiveModColorEffect` was registered ahead of `OneShot` in
`KALEIDOSCOPE_INIT_PLUGINS()`, `OSM()` and `OSL()` keys would light up in the
OneShot "sticky" state, not in the "held" or "one-shot" states. This happened
because OneShot changes the `event.key` value to the corresponding base
key (modifier or layer shift), but if ActiveModColor had already processed that
key event, it wouldn't recognize the key as a modifier/layer shift key, and
would therefore ignore it.

This change makes ActiveModColor also recognize OneShot keys as modifier/layer
shift keys.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1024/head
Michael Richters 4 years ago
parent 60567d3d50
commit 17045d9294
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -45,6 +45,7 @@ EventHandlerResult ActiveModColorEffect::onKeyEvent(KeyEvent &event) {
// we also highlight modifier and layer-shift keys.
if (event.key.isKeyboardModifier() ||
event.key.isLayerShift() ||
::OneShot.isOneShotKey(event.key) ||
::OneShot.isActive(event.addr)) {
mod_key_bits_.set(event.addr);
}

Loading…
Cancel
Save