diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-03-31 19:38:06 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-31 22:38:06 -0400 |
| commit | 61a2169ff9dea52136139ec156995efdc7929851 (patch) | |
| tree | 5aebd210218859e55b211f10684ef15fc23f9dcc /users/drashna/readme.md | |
| parent | adae37f19f0d16b703e1ebce0449822492098444 (diff) | |
| download | qmk_firmware-61a2169ff9dea52136139ec156995efdc7929851.tar.gz qmk_firmware-61a2169ff9dea52136139ec156995efdc7929851.zip | |
Update to Drashna Keymaps and Userspace (#2650)
* Change global config.h settings
* Make Shift LED brighter
* Compatibility Tweaks
* Update ASCII art and layer comments
* Add comments about MOD layer
* Change ASCII art for reset, since it was out of date
* Use Overwatch theme for Workman layer
* Fix RGB define comments
* Make sure RGB set list matches
* Stop all notes for custom Faux Click
* Switch to OSM for everything, and remove RGB Sleep
* Never use KEYMAP now
* Only enable RGB Sleep on Non-Ergodox boards
* Cleanup do to new rgblight_list.h file
* Add redirect message for RGB codes
* Update userspace documentation
* Cleanup of Userspace
Add unicode support, and cleaned up comments for ifdef statements
* Remove unneeded slashes
* Unicode handling
* Force NKRO
Diffstat (limited to 'users/drashna/readme.md')
| -rw-r--r-- | users/drashna/readme.md | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/users/drashna/readme.md b/users/drashna/readme.md index 2229a3fe0..e3e5d399d 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md | |||
| @@ -12,7 +12,7 @@ The reason for using seperate files here is that the `drashna.h` file doesn't ge | |||
| 12 | 12 | ||
| 13 | However, the `rules.mk` file is included when building the firmware. So we can hijack that process to "manually" add a `config.h`. To do so, you would need to add the following to the `rules.mk` in your userspace: | 13 | However, the `rules.mk` file is included when building the firmware. So we can hijack that process to "manually" add a `config.h`. To do so, you would need to add the following to the `rules.mk` in your userspace: |
| 14 | 14 | ||
| 15 | ``` | 15 | ```c |
| 16 | ifneq ("$(wildcard users/$(KEYMAP)/config.h)","") | 16 | ifneq ("$(wildcard users/$(KEYMAP)/config.h)","") |
| 17 | CONFIG_H += users/$(KEYMAP)/config.h | 17 | CONFIG_H += users/$(KEYMAP)/config.h |
| 18 | endif | 18 | endif |
| @@ -22,7 +22,7 @@ You can replace `$(KEYMAP)` with your name, but it's not necessary. This checks | |||
| 22 | 22 | ||
| 23 | As for the `config.h` file, you want to make sure that it has an "ifdef" in it to make sure it's only used once. So you want something like this: | 23 | As for the `config.h` file, you want to make sure that it has an "ifdef" in it to make sure it's only used once. So you want something like this: |
| 24 | 24 | ||
| 25 | ``` | 25 | ```c |
| 26 | #ifndef USERSPACE_CONFIG_H | 26 | #ifndef USERSPACE_CONFIG_H |
| 27 | #define USERSPACE_CONFIG_H | 27 | #define USERSPACE_CONFIG_H |
| 28 | 28 | ||
| @@ -122,7 +122,7 @@ If you would *also* like to take advantage of this feature, you'll first want to | |||
| 122 | Then you can create this file and add your macro strings to it: | 122 | Then you can create this file and add your macro strings to it: |
| 123 | 123 | ||
| 124 | ###### secrets.h | 124 | ###### secrets.h |
| 125 | ``` | 125 | ```c |
| 126 | PROGMEM const char secret[][64] = { | 126 | PROGMEM const char secret[][64] = { |
| 127 | "secret1", | 127 | "secret1", |
| 128 | "secret2", | 128 | "secret2", |
| @@ -132,11 +132,29 @@ PROGMEM const char secret[][64] = { | |||
| 132 | }; | 132 | }; |
| 133 | ``` | 133 | ``` |
| 134 | 134 | ||
| 135 | Replacing the strings with the codes that you need. | 135 | Replacing the strings with the codes that you need. |
| 136 | 136 | ||
| 137 | In the `<name>.c` file, you will want to add this to the top: | ||
| 137 | 138 | ||
| 138 | These are called in the `process_record_user` function, using this block: | 139 | ```c |
| 140 | |||
| 141 | #if (__has_include("secrets.h") && !defined(NO_SECRETS)) | ||
| 142 | #include "secrets.h" | ||
| 143 | #else | ||
| 144 | // `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware | ||
| 145 | // And I'm not familiar enough to know which is better or why... | ||
| 146 | PROGMEM const char secret[][64] = { | ||
| 147 | "test1", | ||
| 148 | "test2", | ||
| 149 | "test3", | ||
| 150 | "test4", | ||
| 151 | "test5" | ||
| 152 | }; | ||
| 153 | #endif | ||
| 139 | ``` | 154 | ``` |
| 155 | |||
| 156 | And then, in the `process_record_user` function, you'll want to add this block: | ||
| 157 | ```c | ||
| 140 | case KC_SECRET_1 ... KC_SECRET_5: | 158 | case KC_SECRET_1 ... KC_SECRET_5: |
| 141 | if (!record->event.pressed) { | 159 | if (!record->event.pressed) { |
| 142 | send_string_P(secret[keycode - KC_SECRET_1]); | 160 | send_string_P(secret[keycode - KC_SECRET_1]); |
| @@ -145,4 +163,13 @@ These are called in the `process_record_user` function, using this block: | |||
| 145 | break; | 163 | break; |
| 146 | ``` | 164 | ``` |
| 147 | 165 | ||
| 148 | And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined, as well. | 166 | And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `<name>.h` file fo the new macros, as well. |
| 167 | |||
| 168 | Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users/<name>/rules.mk`, so that it catches the flag: | ||
| 169 | ```c | ||
| 170 | ifeq ($(strip $(NO_SECRETS)), yes) | ||
| 171 | OPT_DEFS += -DNO_SECRETS | ||
| 172 | endif | ||
| 173 | ``` | ||
| 174 | |||
| 175 | Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your `<name>.c` file, rather than reading from your file. | ||
