Browse Source

Apply suggestions from code review

From lesshonor. Thanks.

Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
pull/22653/head
xoedusk 3 months ago
parent
commit
df47bc1e09
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      docs/keymap.md

+ 3
- 3
docs/keymap.md View File

@ -8,7 +8,7 @@ In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds
For trivial key definitions, the higher 8 bits of the **action code** are all 0 and the lower 8 bits holds the USB HID usage code generated by the key as **keycode**.
More than one layer can be active simultaneously. Layers are indexed with 0 to 31 and higher layer index has higher precedence.
More than one layer can be active simultaneously. Layers are indexed with 0 to 31 and higher layer indexes have higher precedence.
Keymap: 32 Layers Layer: action code matrix
----------------- ---------------------
@ -72,7 +72,7 @@ On the other hand, you can change `layer_state` to overlay the base layer with o
### Layer Precedence and Transparency
Note that ***higher layers have higher precedence within the stack of layers***. When a physical key is pressed, 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, sends that keycode and stops searching. Lower layers aren't searched even if active.
Note that ***higher layers have higher precedence within the stack of layers***. When a physical key is pressed, 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, that keycode is sent and the search is stopped. Lower layers aren't searched even if active.
____________
/ / <--- Higher layer
@ -125,7 +125,7 @@ At the top of the file you'll find this:
_CL,
};
Since layer `_BL` is defined first in the enum, it will have the lowest precedence (keymap layer '0') and will be the default layer at firmware startup. Layer `_CL` will have the higest precedence. Using names like these for the layers rather than numbers makes it easier to refer to them in subsequent code. The custom `GRAVE_MODS` definition is used later in a custom function.
Since layer `_BL` is defined first in the enum, it will have the lowest precedence (keymap layer '0') and will be the default layer at firmware startup. Layer `_CL` will have the highest precedence. Using names like these for the layers rather than numbers makes it easier to refer to them in subsequent code. The custom `GRAVE_MODS` definition is used later in a custom function.
Note: You may also find some older keymap files may also have a define(s) for `_______` and/or `XXXXXXX`. These can be used in place for `KC_TRNS` and `KC_NO` respectively, making it easier to see what keys a layer is overriding. These definitions are now unnecessary, as they are included by default.


Loading…
Cancel
Save