diff options
author | Joel Spadin <[email protected]> | 2023-10-06 20:04:41 -0500 |
---|---|---|
committer | Joel Spadin <[email protected]> | 2023-12-04 20:06:54 -0600 |
commit | d4e8dee44479864af5bef1b88a71d40b9e8edabf (patch) | |
tree | 18f08de64bcbdaa898c3f196f3e08a82215e9289 /app/src/keymap.c | |
parent | ba5637fdefc5aff8e57ec9172887405dcb363bb1 (diff) | |
download | zmk-d4e8dee44479864af5bef1b88a71d40b9e8edabf.tar.gz zmk-d4e8dee44479864af5bef1b88a71d40b9e8edabf.zip |
refactor(keymaps): Rename layer label to "display-name"
Changed the property used to define a layer name for displays from
"label" (which affects other things in Zephyr and is deprecated) to
"display-name". (It cannot be named simply "name", because that has
special meaning in newer versions of the devicetree compiler.)
"label" is still supported as a fallback, so no changes need to be made
to existing keymaps.
Diffstat (limited to 'app/src/keymap.c')
-rw-r--r-- | app/src/keymap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/keymap.c b/app/src/keymap.c index ca41e34adc..f2aa342685 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -52,7 +52,7 @@ static uint8_t _zmk_keymap_layer_default = 0; #endif /* ZMK_KEYMAP_HAS_SENSORS */ -#define LAYER_LABEL(node) DT_PROP_OR(node, label, NULL) +#define LAYER_NAME(node) DT_PROP_OR(node, display_name, DT_PROP_OR(node, label, NULL)) // State @@ -65,7 +65,7 @@ static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_ DT_INST_FOREACH_CHILD_SEP(0, TRANSFORMED_LAYER, (, ))}; static const char *zmk_keymap_layer_names[ZMK_KEYMAP_LAYERS_LEN] = { - DT_INST_FOREACH_CHILD_SEP(0, LAYER_LABEL, (, ))}; + DT_INST_FOREACH_CHILD_SEP(0, LAYER_NAME, (, ))}; #if ZMK_KEYMAP_HAS_SENSORS @@ -145,7 +145,7 @@ bool is_active_layer(uint8_t layer, zmk_keymap_layers_state_t layer_state) { return (layer_state & BIT(layer)) == BIT(layer) || layer == _zmk_keymap_layer_default; } -const char *zmk_keymap_layer_label(uint8_t layer) { +const char *zmk_keymap_layer_name(uint8_t layer) { if (layer >= ZMK_KEYMAP_LAYERS_LEN) { return NULL; } |