Custom Per Layer LED Colors

Had this working on my old firmware a few years ago, but the Kaleidoscope API seems to have changed and now I’m having trouble figuring it out. My goal is that when I toggle to some layer other than layer 0, I want the layer toggle key lit up in red so that I know I’m on an alternate layer and what key to press to get back to layer 0.

Nice to have: I’d also like to set a default color scheme for layer 0, and restore it when returning to the home layer.

Using Chrysalis is not an option for me because I have a mouse navigation layer that I use a lot, and Chrysalis doesn’t have good support for this last I checked.

Whoops, found a post with the answer to this, and it looks like I read it some time ago and forgot about it. :sweat_smile:

This is what you get for leaving your firmware file on your work computer and then not copying it when you switch jobs…

Did you manage to get this working? If so, can you share your .ino file? The only useful info I can find on this is the old post you mentioned, which is a bit hard to follow.

Sure, here it is
Model01-Firmware.ino (22.3 KB)

Most interesting part to look at is the LayerColorOverride class. I have (currently) the rainbow wave effect on the main layer, and then custom colors to indicate the “numpad” and “mouse” layers.

The most confusing part about this IMO is figuring out which KeyAddr corresponds to which specific key, although you can easily do some trial and error to work that out. IIRC, it’s just a 2d array with four “rows” and 16 “columns” - “row” and “column” don’t apply as cleanly to the middle columns and the rows of thumb keys, but it’s easy enough to do some trial and error to work out the physical mapping in those cases.

FWIW, the row & columns used for KeyAddr are the same as the names used in here:

Or, for a more visual representation:

http://www.keyboard-layout-editor.com/#/gists/208ec9c7f9a08382c101b558f1d983b1

2 Likes

Thanks for this info, i’ll give it a look this weekend. :slight_smile:

So this is interesting: I ported this firmware pretty much verbatim to my Model100 when I got it. It seems to work fine, except for a very odd bug. In the “NUMPAD” layer, the CRGB values seem to be interpreted backwards. For example, the key marked CRGB(160, 0, 0) appears blue, while the keys marked CRGB(0, 0, 170) are red. It’s only an issue on that one layer, and only on the Model100.

I’m fairly certain that this is the NumPad plugin in play. The NumPad plugin will override any other LED mode on the NUMPAD layer. Is the blue key breathing? If so, that’s 100% NumPad. I’d suggest disabling that plugin if you want custom colors on that layer.

1 Like

Indeed it is! Thanks, I bet that’s it then!

Since I first found this post after finding a bundled plugin:
As of mars 2023, you can use several plugins to achieve these per mod led colors
e.g.

See more plugins Bundled plugins — Kaleidoscope documentation, and led documentation.

1 Like