Skip to content

Commit 142ebae

Browse files
authored
[Docs] Clarify layer transparency keymap.md (qmk#9081)
* Revised the grammar and clarity of the Layer Precedence and Transparency * Update docs/keymap.md * Update docs/keymap.md * Update docs/keymap.md * Update docs/keymap.md * Update docs/keymap.md * Update docs/keymap.md * Update docs/keymap.md
1 parent bbd17de commit 142ebae

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

docs/keymap.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,22 @@ On the other hand, you can change `layer_state` to overlay the base layer with o
7171

7272

7373
### Layer Precedence and Transparency
74-
Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
75-
76-
You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
77-
Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
74+
Note that ***higher layers have higher priority within the stack of layers***. The firmware works its way down from the highest active layers to look up keycodes. Once the firmware locates a keycode other than `KC_TRNS` (transparent) on an active layer, it stops searching, and lower layers aren't referenced.
75+
76+
____________
77+
/ / <--- Higher layer
78+
/ KC_TRNS //
79+
/___________// <--- Lower layer (KC_A)
80+
/___________/
81+
82+
In the above scenario, the non-transparent keys on the higher layer would be usable, but whenever `KC_TRNS` (or equivalent) is defined, the keycode (`KC_A`) on the lower level would be used.
83+
84+
**Note:** Valid ways to denote transparency on a given layer:
85+
* `KC_TRANSPARENT`
86+
* `KC_TRNS` (alias)
87+
* `_______` (alias)
88+
89+
These keycodes allow the processing to fall through to lower layers in search of a non-transparent keycode to process.
7890

7991
## Anatomy of a `keymap.c`
8092

0 commit comments

Comments
 (0)