-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add documentation for config options #722
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
86f2281
docs: Add documentation for config options
joelspadin 5190ea8
feat(docs): Update kscan config docs
joelspadin c76a173
feat(docs): Update behavior config docs
joelspadin c1f0caa
feat(docs): Update display config docs
joelspadin ec7620c
feat(docs): Update power config docs
joelspadin 0732b33
feat(docs): Update general system config docs
joelspadin abab4c2
feat(docs): Updating lighting config docs
joelspadin c5faad8
fix(docs): Fix links in config pages
joelspadin 56c7ba5
feat(docs): Update configuration overview
joelspadin 43611ba
fix(docs): Update config docs for review feedback
joelspadin fc3ce70
feat(docs): Clarify descriptions of config files
joelspadin 5ee11af
feat(docs): Update direct GPIO configuration
joelspadin bd002bb
feat(docs): Add a simpler matrix transform example
joelspadin fa6f126
feat(docs): Update power and lighting config pages
joelspadin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Backlight Configuration | ||
sidebar_label: Backlight | ||
--- | ||
|
||
See the [backlight feature page](../features/backlight.md) for more details, including instructions for adding backlight support to a board. | ||
|
||
See [Configuration Overview](index.md) for instructions on how to change these settings. | ||
|
||
## Kconfig | ||
|
||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig) | ||
|
||
| Option | Type | Description | Default | | ||
| ------------------------------------ | ---- | ----------------------------------------------------- | ------- | | ||
| `CONFIG_ZMK_BACKLIGHT` | bool | Enables LED backlight | n | | ||
| `CONFIG_ZMK_BACKLIGHT_BRT_STEP` | int | Brightness step in percent | 20 | | ||
| `CONFIG_ZMK_BACKLIGHT_BRT_START` | int | Default brightness in percent | 40 | | ||
| `CONFIG_ZMK_BACKLIGHT_ON_START` | bool | Default backlight state | y | | ||
| `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE` | bool | Turn off backlight when keyboard goes into idle state | n | | ||
| `CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB` | bool | Turn off backlight when USB is disconnected | n | | ||
|
||
:::note | ||
The `*_START` settings only determine the initial backlight state. Any changes you make with the [backlight behavior](../behaviors/backlight.md) are saved to flash after a one minute delay and will be used after that. | ||
::: | ||
|
||
## Devicetree | ||
|
||
Applies to: [`/chosen` node](https://docs.zephyrproject.org/latest/build/dts/intro.html#aliases-and-chosen-nodes) | ||
|
||
| Property | Type | Description | | ||
| --------------- | ---- | -------------------------------------------- | | ||
| `zmk,backlight` | path | The node for the backlight LED driver to use | | ||
|
||
See the Zephyr devicetree bindings for LED drivers: | ||
|
||
- [gpio-leds](https://docs.zephyrproject.org/latest/build/dts/api/bindings/gpio/gpio-leds.html) | ||
- [pwm-leds](https://docs.zephyrproject.org/latest/build/dts/api/bindings/led/pwm-leds.html) | ||
|
||
See the [backlight feature page](../features/backlight.md) for examples of the properties that must be set to enable backlighting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Battery Level | ||
sidebar_label: Battery Level | ||
--- | ||
|
||
See the [battery level feature page](../features/battery.md) for more details on configuring a battery sensor. | ||
|
||
See [Configuration Overview](index.md) for instructions on how to change these settings. | ||
|
||
### Devicetree | ||
|
||
Applies to: [`/chosen` node](https://docs.zephyrproject.org/latest/guides/dts/intro.html#aliases-and-chosen-nodes) | ||
|
||
| Property | Type | Description | | ||
| ------------- | ---- | --------------------------------------------- | | ||
| `zmk,battery` | path | The node for the battery sensor driver to use | | ||
|
||
## Battery Voltage Divider Sensor | ||
|
||
Driver for reading the voltage of a battery using an ADC connected to a voltage divider. | ||
|
||
### Devicetree | ||
|
||
Applies to: `compatible = "zmk,battery-voltage-divider"` | ||
|
||
See [Zephyr's voltage divider documentation](https://docs.zephyrproject.org/latest/build/dts/api/bindings/adc/voltage-divider.html). | ||
|
||
## nRF VDDH Battery Sensor | ||
|
||
Driver for reading the voltage of a battery using a Nordic nRF52's VDDH pin. This driver has no configuration except for the required `label` property. | ||
|
||
### Devicetree | ||
|
||
Applies to: `compatible = "zmk,battery-nrf-vddh"` | ||
|
||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-nrf-vddh.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/sensor/zmk%2Cbattery-nrf-vddh.yaml) | ||
|
||
| Property | Type | Description | | ||
| -------- | ------ | ------------------------- | | ||
| `label` | string | Unique label for the node | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
--- | ||
title: Behavior Configuration | ||
sidebar_label: Behaviors | ||
--- | ||
|
||
Some behaviors have properties to adjust how they behave. These can also be used as templates to create custom behaviors when none of the built-in behaviors do what you want. | ||
|
||
See [Configuration Overview](index.md) for instructions on how to change these settings. | ||
|
||
See the [zmk/app/dts/behaviors/](https://github.com/zmkfirmware/zmk/tree/main/app/dts/behaviors) folder for all default behaviors. | ||
|
||
## Caps Word | ||
|
||
Creates a custom behavior that behaves similar to a caps lock but deactivates when any key not in a continue list is pressed. | ||
|
||
See the [caps word behavior](../behaviors/caps-word.md) documentation for more details and examples. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-caps-word.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-caps-word.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-caps-word"` | ||
|
||
| Property | Type | Description | Default | | ||
| ---------------- | ------ | ------------------------------------------------------------------ | -------------- | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must be `<0>` | | | ||
| `continue-list` | array | List of [key codes](/docs/codes) which do not deactivate caps lock | `<UNDERSCORE>` | | ||
| `mods` | int | A bit field of modifiers to apply | `<MOD_LSFT>` | | ||
|
||
`continue-list` is treated as if it always includes alphanumeric characters (A-Z, 0-9). | ||
|
||
See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/modifiers.h) for a list of modifiers. | ||
|
||
You can use the following nodes to tweak the default behaviors: | ||
|
||
| Node | Behavior | | ||
| ------------ | -------------------------------------- | | ||
| `&caps_word` | [Caps Word](../behaviors/caps-word.md) | | ||
|
||
## Hold-Tap | ||
|
||
Creates a custom behavior that triggers one behavior when a key is held or a different one when the key is tapped. | ||
|
||
See the [hold-tap behavior documentation](../behaviors/hold-tap.md) for more details and examples. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-hold-tap.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-hold-tap.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-hold-tap"` | ||
|
||
| Property | Type | Description | Default | | ||
| ---------------------------- | ------------- | ----------------------------------------------------------------------------------------- | ------------------ | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must be `<2>` | | | ||
| `bindings` | phandle array | A list of two behaviors (without parameters): one for hold and one for tap | | | ||
| `flavor` | string | Adjusts how the behavior chooses between hold and tap | `"hold-preferred"` | | ||
| `tapping-term-ms` | int | How long in milliseconds the key must be held to trigger a hold | | | ||
| `quick-tap-ms` | int | Tap twice within this period (in milliseconds) to trigger a tap, even when held | -1 (disabled) | | ||
| `global-quick-tap` | bool | If enabled, `quick-tap-ms` also applies when tapping another key and then this one. | false | | ||
| `retro-tap` | bool | Triggers the tap behavior on release if no other key was pressed during a hold | false | | ||
| `hold-trigger-key-positions` | array | If set, pressing the hold-tap and then any key position _not_ in the list triggers a tap. | | | ||
|
||
The `flavor` property may be one of: | ||
|
||
- `"hold-preferred"` | ||
- `"balanced"` | ||
- `"tap-preferred"` | ||
- `"tap-unless-interrupted"` | ||
|
||
See the [hold-tap behavior documentation](../behaviors/hold-tap.md) for an explanation of each flavor. | ||
|
||
`hold-trigger-key-positions` is an array of zero-based key position indices. | ||
|
||
You can use the following nodes to tweak the default behaviors: | ||
|
||
| Node | Behavior | | ||
| ----- | --------------------------------------------- | | ||
| `<` | [Layer-tap](../behaviors/layers.md#layer-tap) | | ||
| `&mt` | [Mod-tap](../behaviors/mod-tap.md) | | ||
|
||
## Key Repeat | ||
|
||
Creates a custom behavior that repeats the whatever key code was last sent. | ||
|
||
See the [key repeat behavior](../behaviors/key-repeat.md) documentation for more details and examples. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-key-repeat.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-key-repeat.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-key-repeat"` | ||
|
||
| Property | Type | Description | Default | | ||
| ---------------- | ------ | -------------------------------- | ----------------- | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must be `<0>` | | | ||
| `usage-pages` | array | List of HID usage pages to track | `<HID_USAGE_KEY>` | | ||
|
||
For the `usage-pages` property, use the `HID_USAGE_*` defines from [dt-bindings/zmk/hid_usage_pages.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/hid_usage_pages.h). | ||
|
||
You can use the following nodes to tweak the default behaviors: | ||
|
||
| Node | Behavior | | ||
| ------------- | ---------------------------------------- | | ||
| `&key_repeat` | [Key repeat](../behaviors/key-repeat.md) | | ||
|
||
## Macro | ||
|
||
Creates a custom behavior which triggers a sequence of other behaviors. | ||
|
||
See the [macro behavior](../behaviors/macros.md) documentation for more details and examples. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-macro.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-macro"` | ||
|
||
| Property | Type | Description | Default | | ||
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------- | ------- | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must be `<0>` | | | ||
| `bindings` | phandle array | List of behaviors to trigger | | | ||
| `wait-ms` | int | The default time to wait (in milliseconds) before triggering the next behavior. | 100 | | ||
| `tap-ms` | int | The default time to wait (in milliseconds) between the press and release events of a tapped behavior. | 100 | | ||
|
||
The following macro-specific behaviors can be added at any point in the `bindings` list to change how the macro triggers subsequent behaviors. | ||
|
||
| Behavior | Description | | ||
| -------------------------- | ----------------------------------------------------------------------------------------------------- | | ||
| `¯o_tap` | Switches to tap mode | | ||
| `¯o_press` | Switches to press mode | | ||
| `¯o_release` | Switches to release mode | | ||
| `¯o_pause_for_release` | Pauses the macro until the macro key itself is released | | ||
| `¯o_wait_time TIME` | Changes the time to wait (in milliseconds) before triggering the next behavior. | | ||
| `¯o_tap_time TIME` | Changes the time to wait (in milliseconds) between the press and release events of a tapped behavior. | | ||
|
||
## Mod-Morph | ||
|
||
Creates a custom behavior that triggers one of two behaviors depending on whether certain modifiers are held. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-mod-morph.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-mod-morph.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-mod-morph"` | ||
|
||
| Property | Type | Description | | ||
| ---------------- | ------------- | --------------------------------------------------------------------------------- | | ||
| `label` | string | Unique label for the node | | ||
| `#binding-cells` | int | Must be `<0>` | | ||
| `bindings` | phandle array | A list of two behaviors: one for normal press and one for mod morphed press | | ||
| `mods` | int | A bit field of modifiers. The morph behavior is used if any of these are pressed. | | ||
|
||
See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/modifiers.h) for a list of modifiers. | ||
|
||
You can use the following nodes to tweak the default behaviors: | ||
|
||
| Node | Behavior | | ||
| -------- | ----------------------------------------- | | ||
| `&gresc` | [Grave escape](../behaviors/mod-morph.md) | | ||
|
||
## Sticky Key | ||
|
||
Creates a custom behavior that triggers a behavior and keeps it pressed it until another key is pressed and released. | ||
|
||
See the [sticky key behavior](../behaviors/sticky-key.md) and [sticky layer behavior](../behaviors/sticky-layer.md) documentation for more details and examples. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-sticky-key.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-sticky-key.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-sticky-key"` | ||
|
||
| Property | Type | Description | Default | | ||
| ------------------ | ------------- | ------------------------------------------------------------------------ | ------- | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must match the number of parameters the `bindings` behavior uses | | | ||
| `bindings` | phandle array | A behavior (without parameters) to trigger | | | ||
| `release-after-ms` | int | Releases the key after this many milliseconds if no other key is pressed | 1000 | | ||
| `quick-release` | bool | Release the sticky key on the next key press instead of release | false | | ||
| `ignore-modifiers` | bool | If enabled, pressing a modifier key does not cancel the sticky key | true | | ||
|
||
You can use the following nodes to tweak the default behaviors: | ||
|
||
| Node | Behavior | | ||
| ----- | -------------------------------------------- | | ||
| `&sk` | [Sticky key](../behaviors/sticky-key.md) | | ||
| `&sl` | [Sticky layer](../behaviors/sticky-layer.md) | | ||
|
||
## Tap Dance | ||
|
||
Creates a custom behavior that triggers a different behavior corresponding to the number of times the key is tapped. | ||
|
||
### Devicetree | ||
|
||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-tap-dance.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-tap-dance.yaml) | ||
|
||
Applies to: `compatible = "zmk,behavior-tap-dance"` | ||
|
||
| Property | Type | Description | Default | | ||
| ----------------- | ------------- | -------------------------------------------------------------------------------------------- | ------- | | ||
| `label` | string | Unique label for the node | | | ||
| `#binding-cells` | int | Must be `<0>` | | | ||
| `bindings` | phandle array | A list of behaviors from which to select | | | ||
| `tapping-term-ms` | int | The maximum time (in milliseconds) between taps before an item from `bindings` is triggered. | 200 | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of #1330, the default
continue-list
is now as follows: