Has anyone already written a capslock LED mode, analogous to the numlock LED mode?

Hello, all. As I said in my other thread, I recently received my keyboardio, and I’m enjoying it quite a bit. (Thanks, J+K, for all your effort in bringing the world keyboards that were designed for human hands.)

One feature I’ve set up on my keyboardio is that fn+shift=capslock. (I find this useful when, eg, typing NAMES_OF_CONSTANTS while programming). Ideally, while capslock is enabled, the LEDs would change in a certain way (similar to how they do for numlock). I can likely do this by copying and modifying the numlock LED mode, but I thought I’d check first as to whether this was something someone had already done, so as to avoid duplication of efforts. (My apologies if this has already been discussed elsewhere; I did a brief search of the kaleidoscope repo and the forum history, but not a deep one.)

2 Likes

I know of no such plugin, but there is a reasonably simple way of doing it (with a few gotchas, see about that later): you can make a macro that sends capslock, and sets all the LEDs (via LEDControl.setAllLedsTo, unless I remember its name wrong) to any color you like.

The downside of this is that this only works when the active LED mode is not a dynamic one. To work with those two, a bit more effort would be needed. I’m happy to try and explain that too, if you are interested, but the suggestion above is - I hope - a good starting point, and a reasonable approximation.

As far as I know, this does not exist yet. And I’m still pretty unhappy with how we’re doing NumLock, but having a second use case for that kind of behaviour may help us figure out a better way to do it.

If you’re comfortable with GitHub, would you mind opening a feature request ticket here:

If you’re not, say the word and I’ll do it.

Done :slight_smile:
Thanks, @algernon, I’ll look into making a macro. (I expect the only nontrivial bit is making the macro depend on whether capslock is enabled, which determines whether the LEDs are turned on or off. And also I anticipate that there might be weirdness where, e.g., I start out with “breathing” LEDs and then toggle capslock on and off, and then I’m not super clear on what state the LEDs wind up in. I can likely muddle through, though.)

No need to determine CapsLock, just use it instead of it. All you need is a single bool to keep track of its state, and the macro would send the CapsLock too. May get around it without a state bool, but… this is easier =)

I’ve been thinking about a similar problem I’d like to solve - adding more keys (and more lights) to the numlock layer, and custom colours for active keys in alternate layers.

The solution I was planning on starting on was a plugin that could read static key colour maps, analogous to the existing key binding maps. My initial plan was to use a macro to activate the plugin, but am starting to lean towards binding colour maps to layers in a similar fashion to the current NumLock plugin.

The Colormap plugin does almost exactly that. The downside of it is that at the moment, it reads the colormap from EEPROM, and setting that up is not all that convenient just yet. My layout has an example that may be of use.

In the not so distant future, Chrysalis will be usable for setting this up too. Alternatively, I can explore how to make the Colormap plugin support looking up stuff from PROGMEM too, and then you can hard-code the map into your sketch.

3 Likes

I was thinking the same thing. Minimally I’d like the whole keyboard to change to the active layer’s color (to match it’s color on my keymap cheat sheet). But limiting it to only the active keys on the layer would be a plus. The next level would be to have different colors for different parts of the layer. For example if you had a Function Keys and Numpad layer, the Function Keys could be one color, the Numpad keys another, and say cursor keys still another.

1 Like

Of course I hadn’t looked carefully enough for an existing plugin, there’s apparently still a lot I haven’t explored in the libraries dir. :slight_smile: But that’s great news, thanks for the pointer.

1 Like