Creating a custom LED mode

What I’d like to do is create an LED mode that just lights up the non-letter keys. I type in Colemak, but that’s still relatively new. On my other keyboards I have moved the keys, but until there are alternate keysets, that’s not an option. I’m still learing where keys are on the keyboardio. It’s not a huge deal, but I’d like to be able to light everything except the letter keys. I find the letters visually in the wrong place to be slightly disorienting (although a couple months into Colemak that’s far less of a problem than it was at a couple weeks).

With full understanding of the firmware I’m sure this would be trivial. Before I spend a ton of time hacking, I’m hoping there’s something obvious, like the equivalent of a keymap for the LEDs in some special mode.

I have the “Model01-Firmware” and Arduino pipeline working, and have been doing basic layout hacking. Moving beyond that is the tentative next step, although I have other “day job” hacking to do as well :smile:, so not too much spare time.

Making an LED mode is pretty straightforward; you make a class that subclasses LEDMode, then in the update method, you can set the colour for each LED in 0…LED_COUNT. I believe the LED indices start at zero in the bottom-left, then go up and wrap down (using ::LEDControl.setCrgbAt(row, col, colour) might be better than the method I used below). For example, see:

https://bitbucket.org/jamesnvc/keyboardiolayout/src/83b3df9fa5f82fdc9ada299d98e025148cf7bbd5/james_layout.ino#lines-381

Another option is to use the Colormap plugin, and set up the colors with Chrysalis for each layer. No programming required! It’s a bit boring to set this up though, so if you’re in for a slightly bigger challenge and are interested in poking at the firmware anyway, writing a custom LED mode is the way to go indeed.

And there is the FunctionalColor plugin that might save you some work. Not sure though if it works with current Kaleidoscope.

Yeah, I’ve had reports that it doesn’t work. I still haven’t looked into it any time recently… I suppose I should do that.

Not to bug you, but functional color is one of the Model 01’s “killer apps” to me (I use a lot of layers). I was about to get back into tweaking my firmware again, but I’ll have to hold off for now.

I’ll poke around the code myself, I guess, but I doubt I’ll figure anything out.

1 Like

I’m glad you find it useful. I did put a fair amount of work into making FunctionalColor so I do feel bad that it’s not so useful for people at the moment.

I just got around working with the M01 after a very long time. As a little exercise to get used again to firmware programming I fixed the FunctionalColor plugin. @jdlien, heres the PR.

1 Like

Wow, thanks so much! I will have a look this evening and see if I can get it running and test it out.

Should I make this a new project on Github or will this be reverse compatible with older firmwares as well?

It’s not compatible with older versions of Kaleidoscope. For official plugins, we created a “v1” branch for the older code, and master requires a newer Kaleidoscope.

1 Like