aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2018-08-30 00:32:37 -0400
committerBrian Cully <bjc@kublai.com>2018-08-30 00:32:37 -0400
commit1313d9c623137dedd6772f85a5c3a7461193bf12 (patch)
tree0e14d368cedb7c68b23fb7e15baea179850af1e7 /src
parent3442e117d41c3d77c980b918beb0c1d8411b272f (diff)
downloadKaleidoscope-LayerHighlighter-1313d9c623137dedd6772f85a5c3a7461193bf12.tar.gz
Kaleidoscope-LayerHighlighter-1313d9c623137dedd6772f85a5c3a7461193bf12.zip
Highlight all possible lock keys.
Remove global row/col variables and calculate the breathe effect as the key is crossed during iteration.
Diffstat (limited to 'src')
-rw-r--r--src/Kaleidoscope-LayerHighlighter.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Kaleidoscope-LayerHighlighter.cpp b/src/Kaleidoscope-LayerHighlighter.cpp
index 68c1984..ea05c68 100644
--- a/src/Kaleidoscope-LayerHighlighter.cpp
+++ b/src/Kaleidoscope-LayerHighlighter.cpp
@@ -5,8 +5,6 @@
#include <Kaleidoscope.h>
-byte LayerHighlighter::row = 255, LayerHighlighter::col = 255;
-
kaleidoscope::EventHandlerResult LayerHighlighter::onSetup(void) {
return kaleidoscope::EventHandlerResult::OK;
}
@@ -23,8 +21,8 @@ kaleidoscope::EventHandlerResult LayerHighlighter::afterEachCycle() {
Key layer_key = Layer.getKey(layer, r, c);
if (k == LockLayer(layer)) {
- row = r;
- col = c;
+ cRGB lock_color = breath_compute(lockHue);
+ LEDControl.setCrgbAt(r, c, lock_color);
}
if ((k != layer_key) || (k == Key_NoKey)) {
@@ -35,11 +33,5 @@ kaleidoscope::EventHandlerResult LayerHighlighter::afterEachCycle() {
}
}
- if (row > ROWS || col > COLS)
- return kaleidoscope::EventHandlerResult::OK;
-
- cRGB lock_color = breath_compute(lockHue);
- LEDControl.setCrgbAt(row, col, lock_color);
-
return kaleidoscope::EventHandlerResult::OK;
}