aboutsummaryrefslogtreecommitdiff
path: root/docs/feature_userspace.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/feature_userspace.md')
-rw-r--r--docs/feature_userspace.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md
index 9d7737fe1..950377423 100644
--- a/docs/feature_userspace.md
+++ b/docs/feature_userspace.md
@@ -18,7 +18,7 @@ All this only happens when you build a keymap named `<name>`, like this:
18 18
19 make planck:<name> 19 make planck:<name>
20 20
21For example, 21For example,
22 22
23 make planck:jack 23 make planck:jack
24 24
@@ -32,9 +32,9 @@ Please include authorship (your name, github username, email), and optionally [a
32 32
33For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` . 33For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` .
34 34
35### Consolidated Macros 35### Consolidated Macros
36 36
37If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. The issue is that you then cannot call any function defined in your userspace, or it gets complicated. To better handle this, you can call the functions here and create new functions to use in individual keymaps. 37If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. The issue is that you then cannot call any function defined in your userspace, or it gets complicated. To better handle this, you can call the functions here and create new functions to use in individual keymaps.
38 38
39First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes 39First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
40 40
@@ -47,7 +47,7 @@ Once you've done that, you'll want to set the keycode definitions that you need
47 47
48#include "quantum.h" 48#include "quantum.h"
49 49
50// Define all of 50// Define all of
51enum custom_keycodes { 51enum custom_keycodes {
52 KC_MAKE = SAFE_RANGE, 52 KC_MAKE = SAFE_RANGE,
53 NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes 53 NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes
@@ -90,6 +90,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
90} 90}
91``` 91```
92 92
93This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. 93This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time.
94 94
95Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead). 95Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead).