Hint

Refer to QMK’s documentation for details on how to use community modules

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

State about the LED being checked.

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

uint8_t led_index
[source]

Index of the LED.

uint8_t layer
[source]

Highest active layer.

uint16_t keycode
[source]

Keycode currently mapped to the key where LED belongs.

uint8_t mods
[source]

Active modifiers (bitmask).

uint8_t host_leds
[source]

Active host leds.

struct indicator_checks_t
[source]

Different conditions to be checked

bool layer
[source]

Highest active layer is <X>.

bool keycode
[source]

Keycode is exactly <X>.

bool mods
[source]

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

bool kc_gt_than
[source]

Keycode is greater than <X>.

bool host_leds
[source]

Host leds <x> are active (not an exact match, others can be active too).

struct color_t
[source]

Represent colors in different ways.

color_type_t type
[source]

How this color is specified: rgb, hsv, just hue, …

union [anonymous]
[source]

Inner value.

RGB_COLOR(_rgb...)
[source]

Create a color_t instance from a RGB triplet.

HSV_COLOR(_hsv...)
[source]

Create a color_t instance from a HSV triplet.

enum qmk_hues
[source]

Hue values for QMK builtin colors.

enumerator HUE_AZURE = 132
[source]
enumerator HUE_BLUE = 170
[source]
enumerator HUE_CHARTREUSE = 64
[source]
enumerator HUE_CORAL = 11
[source]
enumerator HUE_CYAN = 128
[source]
enumerator HUE_GOLD = 36
[source]
enumerator HUE_GOLDENROD = 30
[source]
enumerator HUE_GREEN = 85
[source]
enumerator HUE_MAGENTA = 213
[source]
enumerator HUE_ORANGE = 21
[source]
enumerator HUE_PINK = 234
[source]
enumerator HUE_PURPLE = 191
[source]
enumerator HUE_RED = 0
[source]
enumerator HUE_SPRINGGREEN = 106
[source]
enumerator HUE_TEAL = 128
[source]
enumerator HUE_TURQUOISE = 123
[source]
enumerator HUE_YELLOW = 43
[source]
HUE(_hue)
[source]

Create a color_t instance from a hue value.

Note

Sat and val will follow RGB’s global settings.

struct indicator_t
[source]

An indicator’s specification:

color_t color
[source]

Color to be applied if conditions are fulfilled.

indicator_checks_t checks
[source]

Which conditions have to be checked.

indicator_args_t args
[source]

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

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 nor KC_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.

CAPS_LOCK_INDICATOR(_color)
[source]

Indicator for KC_CAPS key(s) while caps lock is active.

Parameters:
  • _color – Color to be applied.

NUM_LOCK_INDICATOR(_color)
[source]

Indicator for KC_NUM key(s) while num lock is active.

Parameters:
  • _color – Color to be applied.