zmk/docs/docs/config/keymap.md
Joel Spadin d4e8dee444 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.
2023-12-04 20:06:54 -06:00

42 lines
1.6 KiB
Markdown

---
title: Keymap Configuration
sidebar_label: Keymap
---
See [Configuration Overview](index.md) for instructions on how to change these settings.
## Keymap
### Devicetree
Applies to: `compatible = "zmk,keymap"`
Definition file: [zmk/app/dts/bindings/zmk,keymap.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk%2Ckeymap.yaml)
The `zmk,keymap` node itself has no properties. It should have one child node per layer of the keymap, starting with the default layer (layer 0).
Each child node can have the following properties:
| Property | Type | Description |
| ----------------- | ------------- | ---------------------------------------------------------------------- |
| `display-name` | string | Name for the layer on displays |
| `bindings` | phandle-array | List of [key behaviors](../features/keymaps.md#behaviors), one per key |
| `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor |
Items for `bindings` must be listed in the order the keys are defined in the [keyboard scan configuration](kscan.md).
Items for `sensor-bindings` must be listed in the order the [sensors](#keymap-sensors) are defined.
## Keymap Sensors
### Devicetree
Applies to: `compatible = "zmk,keymap-sensors"`
| Property | Type | Description |
| --------- | -------- | -------------------- |
| `sensors` | phandles | List of sensor nodes |
The following types of nodes can be used as a sensor:
- [`alps,ec11`](encoders.md#ec11-encoders)