ActiveModColor: Re-scan the keymap if no mods found

If we found no modifiers on the current layer, force a re-scan. This way we'll
scan the keymap without having to change layers first. We can't do the same
thing at `onSetup()` time, because that's too early, so we do a check in
`beforeReportingState()`.

Fixes #608.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/609/head
Gergely Nagy 6 years ago
parent 79c1f75624
commit e03c741703
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -56,6 +56,10 @@ EventHandlerResult ActiveModColorEffect::onLayerChange() {
} }
EventHandlerResult ActiveModColorEffect::beforeReportingState() { EventHandlerResult ActiveModColorEffect::beforeReportingState() {
if (mod_key_count_ == 0) {
onLayerChange();
}
for (uint8_t i = 0; i < mod_key_count_; i++) { for (uint8_t i = 0; i < mod_key_count_; i++) {
uint8_t coords = mod_keys_[i]; uint8_t coords = mod_keys_[i];
byte c = coords % COLS; byte c = coords % COLS;

Loading…
Cancel
Save