From c6a26cb9c76f636a4d81c6742b315e06766425b1 Mon Sep 17 00:00:00 2001 From: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:05:07 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Cem Aksoylar --- docs/docs/behaviors/layers.md | 2 +- docs/docs/features/keymaps.mdx | 8 +++++--- docs/docs/keymap-example.md | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/behaviors/layers.md b/docs/docs/behaviors/layers.md index 4afcf05a..d0e80679 100644 --- a/docs/docs/behaviors/layers.md +++ b/docs/docs/behaviors/layers.md @@ -9,7 +9,7 @@ Often, you may want a certain key position to alter which layers are enabled, ch Some of those behaviors are still in the works; the ones that are working now are documented here. :::note -Activating a layer will not disable layers higher up in the "layer stack". See [Layers](../features/keymaps.mdx#layers) for more information. +Multiple layers can be active at the same time and activating a layer will not deactivate layers higher up in the "layer stack". See [Layers](../features/keymaps.mdx#layers) for more information. ::: ## Defines to Refer to Layers diff --git a/docs/docs/features/keymaps.mdx b/docs/docs/features/keymaps.mdx index 632ca431..f51fe514 100644 --- a/docs/docs/features/keymaps.mdx +++ b/docs/docs/features/keymaps.mdx @@ -46,10 +46,12 @@ in ZMK contains a set of bindings that bind a certain behavior to a certain key All layers are assigned and referred to by a natural number, with the base layer being layer `0`. It is common to [use the C preprocessor to "name" layers](../behaviors/layers.md#defines-to-refer-to-layers), making them more legible. -The default layer (usually the base layer) is always enabled. Certain bound behaviors may enable/disable additional layers. +The default layer (the base layer with index 0) is always enabled. Certain bound behaviors may enable/disable additional layers. When a key location is pressed/released, the _highest-valued currently active_ layer is used. The press/release event is sent to the behavior bound at that position in said layer, for it to perform whatever actions it wants to in reaction to the event. The behavior can choose to "consume" the event, or "pass it along" and let the next highest-valued active layer _also_ get the event (whose behavior may continue "passing it along"). +Note that the _activation_ order isn't relevant for determining the priority of active layers, it is determined _only_ by the definition order. + ## Behavior Bindings Binding a behavior at a certain key position may include up to two extra parameters that are used to @@ -132,7 +134,7 @@ Each layer of your keymap will be nested under the keymap node. Here is an examp &kp A &kp B &kp C >; }; - } + }; ``` Each layer should have: @@ -149,7 +151,7 @@ Here is an example of a trio of layers for a simple 6-key macropad: :::note -Even if layer `1` was to be activated after `2`, layer `2` would still have priority as it is higher valued. Behaviors such as [`&to`](../behaviors/layers.md#to-layer) can be used to enable one layer _and disable all other non-default layers_, though. +Even if layer `1` was to be activated after `2`, layer `2` would still have priority as it is higher valued. Behaviors such as [To Layer (`&to`)](../behaviors/layers.md#to-layer) can be used to enable one layer _and disable all other non-default layers_, though. ::: ### Complete Example diff --git a/docs/docs/keymap-example.md b/docs/docs/keymap-example.md index a2add275..57f40762 100644 --- a/docs/docs/keymap-example.md +++ b/docs/docs/keymap-example.md @@ -29,7 +29,5 @@ &kp LCTRL &kp LALT &trans >; }; - - }; ```