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.
This commit is contained in:
parent
ba5637fdef
commit
d4e8dee444
18 changed files with 51 additions and 44 deletions
|
|
@ -21,7 +21,7 @@
|
|||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
label = "QWERTY";
|
||||
display-name = "QWERTY";
|
||||
// --------------------------------------------------------------------------------
|
||||
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP |
|
||||
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
};
|
||||
|
||||
lower_layer {
|
||||
label = "NUMBER";
|
||||
display-name = "NUMBER";
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
|
||||
// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | |
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
};
|
||||
|
||||
raise_layer {
|
||||
label = "SYMBOL";
|
||||
display-name = "SYMBOL";
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP |
|
||||
// | CTRL | | | | | | | - | = | [ | ] | \ | ` |
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static void layer_status_update_cb(struct layer_status_state state) {
|
|||
|
||||
static struct layer_status_state layer_status_get_state(const zmk_event_t *eh) {
|
||||
uint8_t index = zmk_keymap_highest_layer_active();
|
||||
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_label(index)};
|
||||
return (struct layer_status_state){.index = index, .label = zmk_keymap_layer_name(index)};
|
||||
}
|
||||
|
||||
ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, layer_status_update_cb,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue