-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EEPROM and focus support to ColormapOverlay #1434
base: master
Are you sure you want to change the base?
Add EEPROM and focus support to ColormapOverlay #1434
Conversation
@@ -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_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colormap.overlay
seems like the most logical focus command to me. Let me know what you think.
@EvyBongers did you end up testing this on hardware? |
I completely forgot about this. I'll see about testing it today |
So, I finally got around to testing this. The command returns the palette indexes as expected, but setting the indexes doesn't yet work 🤔 |
So, I dug a little deeper to see what I was missing. I thought I had a quick fix by calling on The confusing part is that Colormap-Overlay (seemed to) need to call Closing this for now |
Reopened because EEPROM supports needs to be added anyway and EEPROM and focus support should land together. |
Just found a comment about this on Discord. Cross-posting to have all of this together.
|
41ea3cb
to
912fc39
Compare
@obra I'm continued worked on this and I have a feeling I'm getting close to having a first draft that can actually compile, but I just found that my idea of using At first glance it looks like implementing this in FocusSerial is as easy adding this bit of code. Can I add that as part of this PR, or would you prefer having a separate PR for that? void read(int8_t &i8) {
i8 = Runtime.serialPort().parseInt();
}
void read(int16_t &i16) {
i16 = Runtime.serialPort().parseInt();
} |
Just pull it out to a separate commit and I'm good :)
…On Tue, Mar 4, 2025 at 1:42 PM Evy Bongers ***@***.***> wrote:
@obra <https://github.com/obra> I'm continued worked on this and I have a
feeling I'm getting close to having a first draft that can actually
compile, but I just found that my idea of using -1 for keys that don't
have an overlay color isn't actually supported by FocusSerial at this
point. See my comments here:
https://github.com/EvyBongers/Kaleidoscope/blob/8db281269e9bf9d2b1cb97c6162f5aa434e45050/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp#L117-L120
At first glance it looks like implementing this in FocusSerial is as easy
adding this bit of code. Can I add that as part of this PR, or would you
prefer having a separate PR for that?
void read(int8_t &i8) {
i8 = Runtime.serialPort().parseInt();
}
void read(int16_t &i16) {
i16 = Runtime.serialPort().parseInt();
}
—
Reply to this email directly, view it on GitHub
<#1434 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2AH75N23PY24JSKBID2SYM57AVCNFSM6AAAAABKYKWNE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJZGAYDKMRWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: EvyBongers]*EvyBongers* left a comment
(keyboardio/Kaleidoscope#1434)
<#1434 (comment)>
@obra <https://github.com/obra> I'm continued worked on this and I have a
feeling I'm getting close to having a first draft that can actually
compile, but I just found that my idea of using -1 for keys that don't
have an overlay color isn't actually supported by FocusSerial at this
point. See my comments here:
https://github.com/EvyBongers/Kaleidoscope/blob/8db281269e9bf9d2b1cb97c6162f5aa434e45050/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp#L117-L120
At first glance it looks like implementing this in FocusSerial is as easy
adding this bit of code. Can I add that as part of this PR, or would you
prefer having a separate PR for that?
void read(int8_t &i8) {
i8 = Runtime.serialPort().parseInt();
}
void read(int16_t &i16) {
i16 = Runtime.serialPort().parseInt();
}
—
Reply to this email directly, view it on GitHub
<#1434 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2AH75N23PY24JSKBID2SYM57AVCNFSM6AAAAABKYKWNE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJZGAYDKMRWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
8db2812
to
2a6ac62
Compare
Signed-off-by: Evy Bongers <[email protected]>
2a6ac62
to
ae4ee9c
Compare
…lay/Focus Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
5113820
to
22d8790
Compare
// It appears that a call to ::LEDPaletteTheme.reserveThemes() is needed | ||
// because it's where palette_base_ gets initialized. Since this plugin (and | ||
// possibly others) don't actually use themes, requesting memory for storing | ||
// themes doesn't make much sense. Maybe initialisation of palette_base_ | ||
// could be moved to a setup() method, though maybe the palette should be | ||
// split from palette theme altogether? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@obra I don't really like having to reserve memory for a theme that I don't even use. I'm happy to remove the comment and just accept it if that's what you prefer, but as stated in the comment I feel it might be better to split initialisation of the palette and logic for themes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that it should be in a 'setup' method? But possibly in a 'reservePalette' method (that the existing 'reserveThemes' would be refactored to call)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine by me. Want a separate PR for that too?
Sure!
…On Tue, Mar 11, 2025 at 12:02 PM Evy Bongers ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp
<#1434 (comment)>
:
> + // It appears that a call to ::LEDPaletteTheme.reserveThemes() is needed
+ // because it's where palette_base_ gets initialized. Since this plugin (and
+ // possibly others) don't actually use themes, requesting memory for storing
+ // themes doesn't make much sense. Maybe initialisation of palette_base_
+ // could be moved to a setup() method, though maybe the palette should be
+ // split from palette theme altogether?
That's fine by me. Want a separate PR for that too?
—
Reply to this email directly, view it on GitHub
<#1434 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALC2BIP2L773YAYSO2ZSL2T4XKVAVCNFSM6AAAAABKYKWNE2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNZVHAYTAOBWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Evy Bongers <[email protected]>
Quick attempt to implement focus support in ColormapOverlay. I feel this should work, but I don't have my keyboard with me right now, so any debugging I'll have to do later.