Skip to content

Commit 08c682c

Browse files
evantraversdrashna
authored andcommitted
Docs: Add docs for the LAYOUT_* macro to layouts (qmk#3772)
When moving my planck layout to my let's split, I ran into this issue because I had copied my planck layout from the default layout which just used the `{}` array form for the keymap layers. I checked the docs, but this bit wasn't clear to me. I'm sure @ishtob or @drashna helped me on discord, but this seemed to be the logical place to add a helpful hint.
1 parent 9bd6d61 commit 08c682c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/feature_layouts.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
5353

5454
## Tips for Making Layouts Keyboard-Agnostic
5555

56+
### Includes
57+
5658
Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled:
5759

5860
#include QMK_KEYBOARD_H
@@ -72,3 +74,7 @@ For example:
7274
```
7375

7476
Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly.
77+
78+
### Keymaps
79+
80+
In order to support both split and non-split keyboards with the same layout, you need to use the keyboard agnostic `LAYOUT_<layout name>` macro in your keymap. For instance, in order for a Let's Split and Planck to share the same layout file, you need to use `LAYOUT_ortho_4x12` instead of `LAYOUT_planck_grid` or just `{}` for a C array.

0 commit comments

Comments
 (0)