summaryrefslogtreecommitdiffstats
path: root/users/drashna/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/readme.md')
-rw-r--r--users/drashna/readme.md39
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
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.