Skip to content

Commit 41ea3cb

Browse files
committed
Add focus support to ColormapOverlay
Signed-off-by: Evy Bongers <[email protected]>
1 parent 622df1c commit 41ea3cb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
namespace kaleidoscope {
3030
namespace plugin {
3131
uint16_t ColormapOverlay::map_base_;
32+
const uint8_t no_themes_ = 1;
3233

3334
void ColormapOverlay::setup() {
34-
map_base_ = ::LEDPaletteTheme.reserveThemes(1);
35+
map_base_ = ::LEDPaletteTheme.reserveThemes(no_themes_);
3536
}
3637

3738
bool ColormapOverlay::hasOverlay(KeyAddr k) {
@@ -73,6 +74,10 @@ EventHandlerResult ColormapOverlay::beforeSyncingLeds() {
7374
return EventHandlerResult::OK;
7475
}
7576

77+
EventHandlerResult ColormapOverlay::onFocusEvent(const char *input) {
78+
return ::LEDPaletteTheme.themeFocusEvent(input, PSTR("colormap.overlay"), map_base_, no_themes_);
79+
}
80+
7681
} // namespace plugin
7782
} // namespace kaleidoscope
7883

plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ColormapOverlay : public kaleidoscope::Plugin {
5858

5959
EventHandlerResult onSetup();
6060
EventHandlerResult beforeSyncingLeds();
61+
EventHandlerResult onFocusEvent(const char *input);
6162

6263
private:
6364
static uint16_t map_base_;

0 commit comments

Comments
 (0)