aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2018-11-21 22:20:14 -0500
committerBrian Cully <bjc@kublai.com>2018-11-21 22:20:14 -0500
commit9e3dc09041aa5ef952033301f304a962da198f62 (patch)
tree9d9beb64cb3157c7523e0b18889b52eda023d43d
parent467f41325964aac147719fb53f21f965b4829057 (diff)
downloadKaleidoscope-LayerHighlighter-9e3dc09041aa5ef952033301f304a962da198f62.tar.gz
Kaleidoscope-LayerHighlighter-9e3dc09041aa5ef952033301f304a962da198f62.zip
Fix returning to previous LED mode when layer is toggled off.
-rw-r--r--src/Kaleidoscope-LayerHighlighter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Kaleidoscope-LayerHighlighter.cpp b/src/Kaleidoscope-LayerHighlighter.cpp
index 30d0611..3ed56cb 100644
--- a/src/Kaleidoscope-LayerHighlighter.cpp
+++ b/src/Kaleidoscope-LayerHighlighter.cpp
@@ -9,8 +9,10 @@ kaleidoscope::EventHandlerResult LayerHighlighter::onSetup(void) {
}
kaleidoscope::EventHandlerResult LayerHighlighter::afterEachCycle() {
- if (!Layer.isOn(layer))
+ if (!Layer.isOn(layer)) {
+ LEDControl.set_mode(LEDControl.get_mode_index());
return kaleidoscope::EventHandlerResult::OK;
+ }
LEDControl.set_mode(LEDControl.get_mode_index());