forked from kofal.net/zmk
feat: Allow layer behaviors to "lock" layers on (#2717)
* refactor(core)!: Allow layer behaviors to "lock" layers on Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com> * docs: Added documentation note on locking layers Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com> --------- Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
@@ -154,6 +154,29 @@ You can use the following node to tweak the default behavior:
|
||||
| ----- | ------------------------------------------------ |
|
||||
| `&kt` | [Key toggle](../keymaps/behaviors/key-toggle.md) |
|
||||
|
||||
## Momentary Layer
|
||||
|
||||
Creates a custom behavior that toggles a layer on when pressed, and off when released.
|
||||
|
||||
See the [momentary layer behavior](../keymaps/behaviors/layers.md#momentary-layer) documentation for more details and examples.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-momentary-layer.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-momentary-layer.yaml)
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-momentary-layer"`
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ---------------- | ---- | --------------------------------------------------------------- | ------- |
|
||||
| `#binding-cells` | int | Must be `<1>` | |
|
||||
| `locking` | bool | Whether the behavior can lock and unlock layers in the on state | false |
|
||||
|
||||
You can use the following node to tweak the default behavior:
|
||||
|
||||
| Node | Behavior |
|
||||
| ----- | ----------------------------------------------------------------- |
|
||||
| `&mo` | [Momentary Layer](../keymaps/behaviors/layers.md#momentary-layer) |
|
||||
|
||||
## Layer Toggle
|
||||
|
||||
Creates a custom behavior that toggles a layer on, off, or switches between the two states.
|
||||
@@ -166,10 +189,11 @@ Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-layer-toggle.yaml]
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-layer-toggle"`
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ---------------- | ---- | ------------------------------ | ------- |
|
||||
| `#binding-cells` | int | Must be `<1>` | |
|
||||
| `toggle-mode` | | One of `on`, `off`, and `flip` | `flip` |
|
||||
| Property | Type | Description | Default |
|
||||
| ---------------- | ---- | --------------------------------------------------------------- | ------- |
|
||||
| `#binding-cells` | int | Must be `<1>` | |
|
||||
| `toggle-mode` | | One of `on`, `off`, and `flip` | `flip` |
|
||||
| `locking` | bool | Whether the behavior can lock and unlock layers in the on state | false |
|
||||
|
||||
You can use the following node to tweak the default behavior:
|
||||
|
||||
@@ -177,6 +201,29 @@ You can use the following node to tweak the default behavior:
|
||||
| ------ | ----------------------------------------------------------- |
|
||||
| `&tog` | [Layer toggle](../keymaps/behaviors/layers.md#toggle-layer) |
|
||||
|
||||
## To Layer
|
||||
|
||||
Creates a custom behavior that toggles a layer on and toggles all other layers off, barring the default layer.
|
||||
|
||||
See the [to layer behavior](../keymaps/behaviors/layers.md#to-layer) documentation for more details and examples.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-to-layer.yaml)
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-to-layer"`
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ---------------- | ---- | --------------------------------------------------------------- | ------- |
|
||||
| `#binding-cells` | int | Must be `<1>` | |
|
||||
| `locking` | bool | Whether the behavior can lock and unlock layers in the on state | false |
|
||||
|
||||
You can use the following node to tweak the default behavior:
|
||||
|
||||
| Node | Behavior |
|
||||
| ----- | --------------------------------------------------- |
|
||||
| `&to` | [To Layer](../keymaps/behaviors/layers.md#to-layer) |
|
||||
|
||||
## Macro
|
||||
|
||||
Creates a custom behavior which triggers a sequence of other behaviors.
|
||||
|
||||
Reference in New Issue
Block a user