forked from mirrors/qmk_userspace
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
This commit is contained in:
parent
adae37f19f
commit
61a2169ff9
8 changed files with 152 additions and 148 deletions
|
@ -12,7 +12,7 @@ The reason for using seperate files here is that the `drashna.h` file doesn't ge
|
|||
|
||||
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:
|
||||
|
||||
```
|
||||
```c
|
||||
ifneq ("$(wildcard users/$(KEYMAP)/config.h)","")
|
||||
CONFIG_H += users/$(KEYMAP)/config.h
|
||||
endif
|
||||
|
@ -22,7 +22,7 @@ You can replace `$(KEYMAP)` with your name, but it's not necessary. This checks
|
|||
|
||||
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:
|
||||
|
||||
```
|
||||
```c
|
||||
#ifndef USERSPACE_CONFIG_H
|
||||
#define USERSPACE_CONFIG_H
|
||||
|
||||
|
@ -122,7 +122,7 @@ If you would *also* like to take advantage of this feature, you'll first want to
|
|||
Then you can create this file and add your macro strings to it:
|
||||
|
||||
###### secrets.h
|
||||
```
|
||||
```c
|
||||
PROGMEM const char secret[][64] = {
|
||||
"secret1",
|
||||
"secret2",
|
||||
|
@ -132,11 +132,29 @@ PROGMEM const char secret[][64] = {
|
|||
};
|
||||
```
|
||||
|
||||
Replacing the strings with the codes that you need.
|
||||
Replacing the strings with the codes that you need.
|
||||
|
||||
In the `<name>.c` file, you will want to add this to the top:
|
||||
|
||||
These are called in the `process_record_user` function, using this block:
|
||||
```c
|
||||
|
||||
#if (__has_include("secrets.h") && !defined(NO_SECRETS))
|
||||
#include "secrets.h"
|
||||
#else
|
||||
// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware
|
||||
// And I'm not familiar enough to know which is better or why...
|
||||
PROGMEM const char secret[][64] = {
|
||||
"test1",
|
||||
"test2",
|
||||
"test3",
|
||||
"test4",
|
||||
"test5"
|
||||
};
|
||||
#endif
|
||||
```
|
||||
|
||||
And then, in the `process_record_user` function, you'll want to add this block:
|
||||
```c
|
||||
case KC_SECRET_1 ... KC_SECRET_5:
|
||||
if (!record->event.pressed) {
|
||||
send_string_P(secret[keycode - KC_SECRET_1]);
|
||||
|
@ -145,4 +163,13 @@ These are called in the `process_record_user` function, using this block:
|
|||
break;
|
||||
```
|
||||
|
||||
And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined, as well.
|
||||
And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `<name>.h` file fo the new macros, as well.
|
||||
|
||||
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:
|
||||
```c
|
||||
ifeq ($(strip $(NO_SECRETS)), yes)
|
||||
OPT_DEFS += -DNO_SECRETS
|
||||
endif
|
||||
```
|
||||
|
||||
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue