diff options
author | Drashna Jaelre <drashna@live.com> | 2021-12-14 20:53:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 20:53:36 -0800 |
commit | 3fa592a4024a24a636fa0c562e6761667a94f565 (patch) | |
tree | 4ce826128e29e36dfe606fa2b5a3d25b3bd0afcc /users/drashna/readme/rgb.md | |
parent | c10bc9f91e737dd3675b2e4492daa09092655af9 (diff) |
[Keymap] Unicode and Pointing Device and Autocorect for drashna keymaps (#15415)
Diffstat (limited to 'users/drashna/readme/rgb.md')
-rw-r--r-- | users/drashna/readme/rgb.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/users/drashna/readme/rgb.md b/users/drashna/readme/rgb.md new file mode 100644 index 0000000000..acf01b051e --- /dev/null +++ b/users/drashna/readme/rgb.md @@ -0,0 +1,43 @@ +# Layer Indication Code + +At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer. + +This works for both the regular layers, and for the default layers, too. + +I use the sethsv variants of the commands, so that different modes can be used, as well. + +RGB Matrix uses a custom, per board implementation, at the moment. + +# RGB Light Startup Animation + +On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color. + +```c +void keyboard_post_init_rgb(void) { +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + if (rgblight_config.enable) { + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + } +#endif + layer_state_set_user(layer_state); +} +``` + +This could probably benefit from some cleanup and better handling. + + +# RGB Light Twinkling + +This enables random twinkling of the LEDs when typing. + +# RGB Light Mod Indicators + +Allows feedback of which mods (oneshot or otherwise) are enabled. |