Skip to content

Commit

Permalink
Add focus support to ColormapOverlay
Browse files Browse the repository at this point in the history
Signed-off-by: Evy Bongers <[email protected]>
  • Loading branch information
EvyBongers committed Jul 12, 2024
1 parent 622df1c commit 41ea3cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
namespace kaleidoscope {
namespace plugin {
uint16_t ColormapOverlay::map_base_;
const uint8_t no_themes_ = 1;

void ColormapOverlay::setup() {
map_base_ = ::LEDPaletteTheme.reserveThemes(1);
map_base_ = ::LEDPaletteTheme.reserveThemes(no_themes_);
}

bool ColormapOverlay::hasOverlay(KeyAddr k) {
Expand Down Expand Up @@ -73,6 +74,10 @@ EventHandlerResult ColormapOverlay::beforeSyncingLeds() {
return EventHandlerResult::OK;
}

EventHandlerResult ColormapOverlay::onFocusEvent(const char *input) {
return ::LEDPaletteTheme.themeFocusEvent(input, PSTR("colormap.overlay"), map_base_, no_themes_);
}

} // namespace plugin
} // namespace kaleidoscope

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ColormapOverlay : public kaleidoscope::Plugin {

EventHandlerResult onSetup();
EventHandlerResult beforeSyncingLeds();
EventHandlerResult onFocusEvent(const char *input);

private:
static uint16_t map_base_;
Expand Down

0 comments on commit 41ea3cb

Please sign in to comment.