From 9d8b4e8f3b02e60dc1cfdde760d45556d779c7e1 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 1 Oct 2022 10:37:22 +0100 Subject: fix handling of the "led" key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit without this, it was impossible to get out of color-picked mode I'm not sure if it ever worked beforeā€¦ --- color-picker.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/color-picker.h b/color-picker.h index 87ddaae..b91ab2d 100644 --- a/color-picker.h +++ b/color-picker.h @@ -61,6 +61,8 @@ public: switch (key) { case OFF: break; + case LED_KEY: + return kaleidoscope::EventHandlerResult::OK; // let other plugins deal with this case SHOW: map[event.addr.row()][event.addr.col()] = current_index; break; case SWITCH_LEFT: @@ -166,7 +168,7 @@ private: return LEDControl.get_mode() == this; } - typedef enum { OFF, SHOW, + typedef enum { OFF, LED_KEY, SHOW, SWITCH_LEFT, SWITCH_RIGHT, COLOR_1, COLOR_2, COLOR_3, COLOR_4, COLOR_5, COLOR_6, COLOR_7, COLOR_8, @@ -183,7 +185,7 @@ private: return SWITCH_RIGHT; } else if (row == 0 && col == 6) { - return OFF; // LED key, always off + return LED_KEY; } // non-editing half? show it @@ -292,6 +294,7 @@ private: case SHOW: return colors[map[row][col]]; case OFF: + case LED_KEY: case SWITCH_LEFT: case SWITCH_RIGHT: return CRGB(0,0,0); -- cgit v1.2.3