From 9dfbe78e1a2f514cdb4bcafad79ab3f671655383 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 16 Aug 2019 19:20:27 +0200 Subject: [PATCH] ActiveModColor: Cache the list of modifiers at setup time too In order for the plugin to work without having to switch layers once, it needs to scan the keymap for modifiers at setup time too. We do this by calling `onLayerChange()`, which already does that. Fixes #670. Signed-off-by: Gergely Nagy --- src/kaleidoscope/plugin/LED-ActiveModColor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kaleidoscope/plugin/LED-ActiveModColor.h b/src/kaleidoscope/plugin/LED-ActiveModColor.h index a75e4a0f..c9ec5f7e 100644 --- a/src/kaleidoscope/plugin/LED-ActiveModColor.h +++ b/src/kaleidoscope/plugin/LED-ActiveModColor.h @@ -37,6 +37,9 @@ class ActiveModColorEffect : public kaleidoscope::Plugin { EventHandlerResult beforeReportingState(); EventHandlerResult onLayerChange(); + EventHandlerResult onSetup() { + return onLayerChange(); + } private: static bool highlight_normal_modifiers_;