indicators¶
Declaratively define RGB indicators.
Your configuration would look like:
#include "elpekenin/indicators.h"
const indicator_t PROGMEM indicators[] = {
LAYER_INDICATOR(UTILS, RGB_COLOR(RGB_OFF)),
KEYCODE_IN_LAYER_INDICATOR(QK_BOOT, UTILS, HSV_COLOR(HSV_RED)),
CAPS_LOCK_INDICATOR(HUE(HUE_BLUE)),
};
- Since indicators are checked (and applied) in the same order that you define them, this config is:
On the layer
UTILS
, all LEDs will be off except forQK_BOOT
which will be redOn every layer, if caps is locked, keys assigned to
KC_CAPS
will be blue (following current saturation and brightness settings)Every other LED/state of the keyboard won’t cause the module to draw, thus preserving QMK’s running animation
Hint
In general, you will use the convenience macros. However, you might need to manually instantiate these data structures to define custom conditions.
-
struct indicator_args_t¶
[source] State about the LED being checked.
Used to tell whether the indicator’s color should be applied.
-
struct indicator_t¶
[source] An indicator’s specification:
-
indicator_checks_t checks¶
[source] Which conditions have to be checked.
-
indicator_args_t args¶
[source] Values used to check (the
<X>
s above).
-
indicator_checks_t checks¶
-
KEYCODE_INDICATOR(_keycode, _color)¶
[source] Indicator on any key mapped to the given keycode.
- Parameters:
_keycode – Value of the keycode.
_color – Color to be applied.
-
LAYER_INDICATOR(_layer, _color)¶
[source] Indicator for all LEDs in the given layer.
- Parameters:
_layer – Where the indicator should fire.
_color – Color to be applied.
-
KEYCODE_IN_LAYER_INDICATOR(_keycode, _layer, _color)¶
[source] Indicator on any key mapped to the given keycode in the given layer.
- Parameters:
_keycode – Value of the keycode.
_layer – Where the indicator should fire.
_color – Color to be applied.
-
ASSIGNED_KEYCODE_IN_LAYER_INDICATOR(_layer, _color)¶
[source] Indicator on any key that has been mapped in the given layer (ie: is not
KC_NO
norKC_TRNS
) .- Parameters:
_layer – Where the indicator should fire.
_color – Color to be applied.
-
KEYCODE_WITH_MOD_INDICATOR(_keycode, mod_mask, _color)¶
[source] Indicator on any key mapped to the given keycode while mods are active.
- Parameters:
_keycode – Value of the keycode.
mod_mask – Bitmask of the modifiers that must be active.
_color – Color to be applied.
-
CUSTOM_KEYCODE_IN_LAYER_INDICATOR(_layer, _color)¶
[source] Indicator on any key mapped to a custom keycode in the given layer.
- Parameters:
_layer – Where the indicator should fire.
_color – Color to be applied.
-
KEYCODE_WITH_HOST_LED_INDICATOR(_keycode, host_mask, _color)¶
[source] Indicator on any key mapped to the given keycode while host LEDs are active.
- Parameters:
_keycode – Value of the keycode.
host_mask – Bitmask of the host LEDs that must be active.
_color – Color to be applied.