X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=docs%2Ffeature_layouts.md;h=b34fd442d5c2f92d0ac460355591ecf894dab84e;hb=7ec583e5efb276ce90a40a1df985de7d0d0b8f46;hp=bfae9204401833efb2f12762b1c95ce3ed3a0cd7;hpb=2018df1a61136f5db5032fc7f0ecb6dff05c6351;p=qmk_firmware.git diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index bfae92044..b34fd442d 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -51,8 +51,39 @@ The folder name must be added to the keyboard's `rules.mk`: but the `LAYOUT_` variable must be defined in `.h` as well. +## Building a Keymap + +You should be able to build the keyboard keymap with a command in this format: + + make : + +### Conflicting layouts +When a keyboard supports multiple layout options, + + LAYOUTS = ortho_4x4 ortho_4x12 + +And a layout exists for both options, +``` +layouts/ ++ community/ +| + ortho_4x4/ +| | + / +| | | + ... +| + ortho_4x12/ +| | + / +| | | + ... +| + ... +``` + +The FORCE_LAYOUT argument can be used to specify which layout to build + + make : FORCE_LAYOUT=ortho_4x4 + make : FORCE_LAYOUT=ortho_4x12 + ## Tips for Making Layouts Keyboard-Agnostic +### Includes + Instead of using `#include "planck.h"`, you can use this line to include whatever `.h` (`.h` should not be included here) file that is being compiled: #include QMK_KEYBOARD_H @@ -72,3 +103,7 @@ For example: ``` Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly. + +### Keymaps + +In order to support both split and non-split keyboards with the same layout, you need to use the keyboard agnostic `LAYOUT_` 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.