feat(underglow): per-key/layer RGB underglow #2752
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a per-key / per-layer RGB underglow that can be configured in the keymap as follows:
bindings: Visual representation of the RGB underglow layer, just like keymap, but for RGB.
&ug
is the simplest behavior that set the specified color. the___
color constant means the RGB is off. You can use predefined color names (defined in app/include/dt-bindings/zmk/rgb_colors.h) or RGB hex code like0xFF0000
for red.&ug_cl COLOR_OFF COLOR_ON
is another behavior that sets the underglow color according to the CAPSLOCK state.&ug_nl
and&ug_sl
do the same for NumLock & ScrollLock respectively.layer-id: This must match the associated keymap layer identifier. You can use the
#define
name such asBASE
,LOWER
,RAISE
...The RGB underglow layer effect can be enabled with the
RGB_TOG
key. Use theRGB_EFF
key to cycle through all effects until the layer effect is enabled. The layer effect is located after the swirl effect, and before the static color effect (the swirl effect will freeze when the layer effect is enabled).The layer effect is available if the
CONFIG_EXPERIMENTAL_RGB_LAYER
Kconfig is set.On split keyboards, the
CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS
Kconfig is required for peripherals to display the HID indicators.This was initially made for the Glove80 last year, but maybe others might find that feature useful.
The code is far from perfect, but I'm willing to improve it if you have any suggestions or recommendations.
Related: #554
PR check-list