diff options
| author | Nick Brassel <nick@tzarc.org> | 2024-05-30 12:00:41 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-30 12:00:41 +1000 |
| commit | 6ef97172889ccd5db376b2a9f8825489e24fdac4 (patch) | |
| tree | 334e3bf41c8554d4bee73a140822f95f60eb64e9 /docs/keymap.md | |
| parent | 395766657ff98a4b1fd0dcba5917557f8acbb9e4 (diff) | |
Vitepress conversion of docs. (#23795)
Diffstat (limited to 'docs/keymap.md')
| -rw-r--r-- | docs/keymap.md | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/keymap.md b/docs/keymap.md index b9c5da6be7..e371fd9ba5 100644 --- a/docs/keymap.md +++ b/docs/keymap.md | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `LAYOUT()` macro to help you create this array of arrays. | 3 | QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `LAYOUT()` macro to help you create this array of arrays. |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | ## Keymap and Layers :id=keymap-and-layers | 6 | ## Keymap and Layers {#keymap-and-layers} |
| 7 | In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most. | 7 | In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most. |
| 8 | 8 | ||
| 9 | 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**. | 9 | 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**. |
| @@ -27,7 +27,7 @@ Respective layers can be validated simultaneously. Layers are indexed with 0 to | |||
| 27 | 27 | ||
| 28 | Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history. | 28 | Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history. |
| 29 | 29 | ||
| 30 | ### Keymap Layer Status :id=keymap-layer-status | 30 | ### Keymap Layer Status {#keymap-layer-status} |
| 31 | 31 | ||
| 32 | The state of the Keymap layer is determined by two 32 bit parameters: | 32 | The state of the Keymap layer is determined by two 32 bit parameters: |
| 33 | 33 | ||
| @@ -137,7 +137,9 @@ After this you'll find the layer definitions. Typically you'll have one or more | |||
| 137 | 137 | ||
| 138 | `keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it. For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard. | 138 | `keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it. For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard. |
| 139 | 139 | ||
| 140 | > TMK from which QMK was forked uses `const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]` instead and holds the 8 bit keycode. | 140 | ::: info |
| 141 | TMK from which QMK was forked uses `const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]` instead and holds the 8 bit keycode. | ||
| 142 | ::: | ||
| 141 | 143 | ||
| 142 | #### Base Layer | 144 | #### Base Layer |
| 143 | 145 | ||
| @@ -185,7 +187,7 @@ Some interesting things to note: | |||
| 185 | 187 | ||
| 186 | This should have given you a basic overview for creating your own keymap. For more details see the following resources: | 188 | This should have given you a basic overview for creating your own keymap. For more details see the following resources: |
| 187 | 189 | ||
| 188 | * [Keycodes](keycodes.md) | 190 | * [Keycodes](keycodes) |
| 189 | * [Keymap FAQ](faq_keymap.md) | 191 | * [Keymap FAQ](faq_keymap) |
| 190 | 192 | ||
| 191 | We are actively working to improve these docs. If you have suggestions for how they could be made better please [file an issue](https://github.com/qmk/qmk_firmware/issues/new)! | 193 | We are actively working to improve these docs. If you have suggestions for how they could be made better please [file an issue](https://github.com/qmk/qmk_firmware/issues/new)! |
