diff options
author | Ryan <fauxpark@gmail.com> | 2021-11-04 16:22:17 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 22:22:17 -0700 |
commit | f529580860cf5a1de4afc10432f218a45daae17a (patch) | |
tree | 1d2fa041174f2586230ab831c05e5b56d8ba4f92 /docs/understanding_qmk.md | |
parent | b06d9d822cfb72e0728b11711a333f2f5d3c631e (diff) | |
download | qmk_firmware-f529580860cf5a1de4afc10432f218a45daae17a.tar.gz qmk_firmware-f529580860cf5a1de4afc10432f218a45daae17a.zip |
Basic keycode overhaul (#14726)
Diffstat (limited to 'docs/understanding_qmk.md')
-rw-r--r-- | docs/understanding_qmk.md | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 42a41fbe2..e0c2ab7dc 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md | |||
@@ -66,10 +66,10 @@ At the keyboard level we define a C macro (typically named `LAYOUT()`) which map | |||
66 | k30, k31, k32, k33, \ | 66 | k30, k31, k32, k33, \ |
67 | k40, k42 \ | 67 | k40, k42 \ |
68 | ) { \ | 68 | ) { \ |
69 | { k00, k01, k02, k03, }, \ | 69 | { k00, k01, k02, k03 }, \ |
70 | { k10, k11, k12, k13, }, \ | 70 | { k10, k11, k12, k13 }, \ |
71 | { k20, k21, k22, KC_NO, }, \ | 71 | { k20, k21, k22, KC_NO }, \ |
72 | { k30, k31, k32, k33, }, \ | 72 | { k30, k31, k32, k33 }, \ |
73 | { k40, KC_NO, k42, KC_NO } \ | 73 | { k40, KC_NO, k42, KC_NO } \ |
74 | } | 74 | } |
75 | ``` | 75 | ``` |
@@ -82,14 +82,15 @@ You can also use this macro to handle unusual matrix layouts, for example the [C | |||
82 | 82 | ||
83 | At the keymap level we make use of our `LAYOUT()` macro above to map keycodes to physical locations to matrix locations. It looks like this: | 83 | At the keymap level we make use of our `LAYOUT()` macro above to map keycodes to physical locations to matrix locations. It looks like this: |
84 | 84 | ||
85 | ``` | 85 | ```c |
86 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 86 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
87 | [0] = LAYOUT( | 87 | [0] = LAYOUT( |
88 | KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ | 88 | KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, |
89 | KC_P7, KC_P8, KC_P9, KC_PPLS, \ | 89 | KC_P7, KC_P8, KC_P9, KC_PPLS, |
90 | KC_P4, KC_P5, KC_P6, \ | 90 | KC_P4, KC_P5, KC_P6, |
91 | KC_P1, KC_P2, KC_P3, KC_PENT, \ | 91 | KC_P1, KC_P2, KC_P3, KC_PENT, |
92 | KC_P0, KC_PDOT) | 92 | KC_P0, KC_PDOT |
93 | ) | ||
93 | } | 94 | } |
94 | ``` | 95 | ``` |
95 | 96 | ||
@@ -123,7 +124,7 @@ And when our current scan completes it will look like this: | |||
123 | } | 124 | } |
124 | ``` | 125 | ``` |
125 | 126 | ||
126 | Comparing against our keymap we can see that the pressed key is KC_NLCK. From here we dispatch to the `process_record` set of functions. | 127 | Comparing against our keymap we can see that the pressed key is `KC_NUM`. From here we dispatch to the `process_record` set of functions. |
127 | 128 | ||
128 | <!-- FIXME: Magic happens between here and process_record --> | 129 | <!-- FIXME: Magic happens between here and process_record --> |
129 | 130 | ||