From: Nick Bair Date: Sun, 27 Mar 2016 02:51:52 +0000 (-0400) Subject: Clarify layer precedence X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=fd4d342568d613438879efdd9e3151f06d75c5f5;p=max%2Ftmk_keyboard.git Clarify layer precedence --- diff --git a/tmk_core/doc/keymap.md b/tmk_core/doc/keymap.md index 572cf2f8..80ea793c 100644 --- a/tmk_core/doc/keymap.md +++ b/tmk_core/doc/keymap.md @@ -86,11 +86,12 @@ default_layer_state_set(1UL<<3); ### 0.2 Layer Precedence and Transparency -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. +Note that ***higher layers have priority in the layer stack***. The firmware starts at the topmost active layer, and works down to the bottom to find the an active keycode. Once the search encounters any keycode other than **`KC_TRNS`** (transparent) on an active layer, the search is halted and the remaining lower layers aren't examined, even if they are active. + +**Note:** a layer must be activated before it may be included in the stack search. + +`KC_TRNS` is a special placeholder which can be used on overlay layers. This allows for the creation of "partial" layers which fall back on the lower layers, eliminating a good deal of repetition in keymap files. -You can place `KC_TRNS` on overlay layer changes just part of layout to fall back on lower or base layer. -Key with `KC_TRANS` doesn't has its own keycode and refers to lower valid layers for keycode, instead. -See example below. ### 0.3 Keymap Example