indicators

Declaratively define RGB indicators.

Your configuration would look like:

const indicator_t PROGMEM indicators[] = {
   LAYER_INDICATOR(UTILS, RGB_OFF),
   KEYCODE_IN_LAYER_INDICATOR(QK_BOOT, UTILS, RGB_RED),
};
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 for QK_BOOT which will be red

  • No indicator to be drawn on other layers (running effect left unchanged)


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_fn_args_t
[source]

State about the LED being checked.

Used to tell whether the indicator’s color should be applied.

enum indicator_flags_t
[source]

Different conditions to be checked

enumerator LAYER = 1
[source]

Highest active layer is <X>.

enumerator KEYCODE = 2
[source]

Keycode is exactly <X>.

enumerator MODS = 4
[source]

Modifiers <X> are active (not an exact match, others can be active too).

enumerator KC_GT_THAN = 8
[source]

Keycode is greater than <X>.

struct indicator_t
[source]

An indicator’s specification:

rgb_t color
[source]

Color to be applied if conditions are fulfilled.

indicator_flags_t flags
[source]

Which conditions have to be checked.

indicator_fn_args_t conditions
[source]

Values used to check (the <X>s above).

KEYCODE_INDICATOR(_keycode, rgb)
[source]

Indicator on any key mapped to the given keycode.

Parameters:
  • _keycode – Value of the keycode.

  • rgb – Color to be applied.

LAYER_INDICATOR(_layer, rgb)
[source]

Indicator for all LEDs in the given layer.

Parameters:
  • _layer – Where the indicator should fire.

  • rgb – Color to be applied.

KEYCODE_IN_LAYER_INDICATOR(_keycode, _layer, rgb)
[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.

  • rgb – Color to be applied.

ASSIGNED_KEYCODE_IN_LAYER_INDICATOR(_layer, rgb)
[source]

Indicator on any key that has been mapped in the given layer (ie: is not KC_NO nor KC_TRNS) .

Parameters:
  • _layer – Where the indicator should fire.

  • rgb – Color to be applied.

KEYCODE_WITH_MOD_INDICATOR(_keycode, mod_mask, rgb)
[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.

  • rgb – Color to be applied.

CUSTOM_KEYCODE_IN_LAYER_INDICATOR(_layer, rgb)
[source]

Indicator on any key mapped to a custom keycode in the given layer.

Parameters:
  • _layer – Where the indicator should fire.

  • rgb – Color to be applied.

bool draw_indicators(uint8_t led_min, uint8_t led_max)
[source]

Check conditions, drawing the indicator if they met, for all leds in the given range.

Parameters:
  • led_min – First LED to be drawn.

  • led_max – Last LED to be drawn.

Warning

Since QMK does not (yet?) allow to hook modules into the RGB system, you need to call this function from within rgb_matrix_indicators_advanced_user