File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,12 @@ EventHandlerResult ColormapOverlay::onFocusEvent(const char *input) {
9999 return EventHandlerResult::OK;
100100
101101 if (::Focus.isEOL ()) {
102- for (uint8_t layer = 0 ; layer < defaultcolormap::colormap_layers; layer++) {
103- for (int8_t i = 0 ; i < Runtime.device ().numKeys (); i++) {
102+ for (uint8_t layer = 0 ; layer < layer_count; layer++) {
103+ for (int8_t key_index_ = 0 ; key_index_ < Runtime.device ().numKeys (); key_index_++) {
104+ KeyAddr k = KeyAddr (key_index_);
104105 for (uint8_t overlay_index{0 }; overlay_index < overlay_count_; ++overlay_index) {
105106 Overlay overlay = overlays_[overlay_index];
106- if ((overlay.addr == k) && (overlay.layer == top_layer )) {
107+ if ((overlay.addr == k) && (overlay.layer == layer )) {
107108 ::Focus.send (overlay.palette_index );
108109 }
109110 }
Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ class ColormapOverlay : public kaleidoscope::Plugin {
7979 void configureOverlays (uint8_t **overlays) {
8080 // First count how many overlays we'll need
8181 uint8_t count = 0 ;
82- for (int layer_ = 0 ; layer_ < _layer_count; layer_++) {
83- for (int key_index_ = 0 ; key_index_ < kaleidoscope_internal::device.matrix_rows * kaleidoscope_internal::device.matrix_columns ; key_index_++) {
82+ for (uint8_t layer_ = 0 ; layer_ < _layer_count; layer_++) {
83+ for (uint8_t key_index_ = 0 ; key_index_ < kaleidoscope_internal::device.matrix_rows * kaleidoscope_internal::device.matrix_columns ; key_index_++) {
8484 int8_t color_index_ = overlays[layer_][key_index_];
8585 if (color_index_ >= 0 && color_index_ < ::LEDPaletteTheme.getPaletteSize () &&
8686 color_index_ != no_color_overlay) {
@@ -113,6 +113,7 @@ class ColormapOverlay : public kaleidoscope::Plugin {
113113 overlays_ = new_overlays;
114114 overlay_count_ = count;
115115 }
116+
116117 // A wildcard value for an overlay that applies on every layer.
117118 static constexpr int8_t layer_wildcard{-1 };
118119 static constexpr int8_t no_color_overlay{-1 };
You can’t perform that action at this time.
0 commit comments