diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/process_keycode/process_terminal.c | 2 | ||||
-rw-r--r-- | quantum/quantum.h | 24 | ||||
-rw-r--r-- | quantum/send_string_keycodes.h | 32 | ||||
-rw-r--r-- | quantum/template/base/keymaps/default/keymap.c | 2 |
4 files changed, 35 insertions, 25 deletions
diff --git a/quantum/process_keycode/process_terminal.c b/quantum/process_keycode/process_terminal.c index f48f3d702..7d1eefa9e 100644 --- a/quantum/process_keycode/process_terminal.c +++ b/quantum/process_keycode/process_terminal.c | |||
@@ -61,7 +61,7 @@ void enable_terminal(void) { | |||
61 | memset(cmd_buffer, 0, CMD_BUFF_SIZE * 80); | 61 | memset(cmd_buffer, 0, CMD_BUFF_SIZE * 80); |
62 | for (int i = 0; i < 6; i++) strcpy(arguments[i], ""); | 62 | for (int i = 0; i < 6; i++) strcpy(arguments[i], ""); |
63 | // select all text to start over | 63 | // select all text to start over |
64 | // SEND_STRING(SS_LCTRL("a")); | 64 | // SEND_STRING(SS_LCTL("a")); |
65 | send_string(terminal_prompt); | 65 | send_string(terminal_prompt); |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/quantum/quantum.h b/quantum/quantum.h index 6beab65a3..91b9170b1 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
@@ -182,30 +182,8 @@ typedef ioline_t pin_t; | |||
182 | # define readPin(pin) palReadLine(pin) | 182 | # define readPin(pin) palReadLine(pin) |
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | // Send string macros | ||
186 | #define STRINGIZE(z) #z | ||
187 | #define ADD_SLASH_X(y) STRINGIZE(\x##y) | ||
188 | #define SYMBOL_STR(x) ADD_SLASH_X(x) | ||
189 | |||
190 | #define SS_TAP_CODE 1 | ||
191 | #define SS_DOWN_CODE 2 | ||
192 | #define SS_UP_CODE 3 | ||
193 | |||
194 | #define SS_TAP(keycode) "\1" SYMBOL_STR(keycode) | ||
195 | #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) | ||
196 | #define SS_UP(keycode) "\3" SYMBOL_STR(keycode) | ||
197 | |||
198 | // `string` arguments must not be parenthesized | ||
199 | #define SS_LCTRL(string) SS_DOWN(X_LCTRL) string SS_UP(X_LCTRL) | ||
200 | #define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) | ||
201 | #define SS_LCMD(string) SS_LGUI(string) | ||
202 | #define SS_LWIN(string) SS_LGUI(string) | ||
203 | #define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) | ||
204 | #define SS_LSFT(string) SS_DOWN(X_LSHIFT) string SS_UP(X_LSHIFT) | ||
205 | #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) | ||
206 | #define SS_ALGR(string) SS_RALT(string) | ||
207 | |||
208 | #define SEND_STRING(string) send_string_P(PSTR(string)) | 185 | #define SEND_STRING(string) send_string_P(PSTR(string)) |
186 | #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) | ||
209 | 187 | ||
210 | extern const bool ascii_to_shift_lut[128]; | 188 | extern const bool ascii_to_shift_lut[128]; |
211 | extern const bool ascii_to_altgr_lut[128]; | 189 | extern const bool ascii_to_altgr_lut[128]; |
diff --git a/quantum/send_string_keycodes.h b/quantum/send_string_keycodes.h index e2deb980a..fc6467a74 100644 --- a/quantum/send_string_keycodes.h +++ b/quantum/send_string_keycodes.h | |||
@@ -340,3 +340,35 @@ | |||
340 | #define X_MEDIA_REWIND bc | 340 | #define X_MEDIA_REWIND bc |
341 | #define X_BRIGHTNESS_UP bd | 341 | #define X_BRIGHTNESS_UP bd |
342 | #define X_BRIGHTNESS_DOWN be | 342 | #define X_BRIGHTNESS_DOWN be |
343 | |||
344 | // Send string macros | ||
345 | #define STRINGIZE(z) #z | ||
346 | #define ADD_SLASH_X(y) STRINGIZE(\x##y) | ||
347 | #define SYMBOL_STR(x) ADD_SLASH_X(x) | ||
348 | |||
349 | #define SS_TAP_CODE 1 | ||
350 | #define SS_DOWN_CODE 2 | ||
351 | #define SS_UP_CODE 3 | ||
352 | |||
353 | #define SS_TAP(keycode) "\1" SYMBOL_STR(keycode) | ||
354 | #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) | ||
355 | #define SS_UP(keycode) "\3" SYMBOL_STR(keycode) | ||
356 | |||
357 | // `string` arguments must not be parenthesized | ||
358 | #define SS_LCTL(string) SS_DOWN(X_LCTL) string SS_UP(X_LCTL) | ||
359 | #define SS_LSFT(string) SS_DOWN(X_LSFT) string SS_UP(X_LSFT) | ||
360 | #define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) | ||
361 | #define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) | ||
362 | #define SS_LCMD(string) SS_LGUI(string) | ||
363 | #define SS_LWIN(string) SS_LGUI(string) | ||
364 | |||
365 | #define SS_RCTL(string) SS_DOWN(X_RCTL) string SS_UP(X_RCTL) | ||
366 | #define SS_RSFT(string) SS_DOWN(X_RSFT) string SS_UP(X_RSFT) | ||
367 | #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) | ||
368 | #define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI) | ||
369 | #define SS_ALGR(string) SS_RALT(string) | ||
370 | #define SS_RCMD(string) SS_RGUI(string) | ||
371 | #define SS_RWIN(string) SS_RGUI(string) | ||
372 | |||
373 | // DEPRECATED | ||
374 | #define SS_LCTRL(string) SS_LCTL(string) | ||
diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 3a68f5487..af35ccec1 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c | |||
@@ -52,7 +52,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
52 | case QMKURL: | 52 | case QMKURL: |
53 | if (record->event.pressed) { | 53 | if (record->event.pressed) { |
54 | // when keycode QMKURL is pressed | 54 | // when keycode QMKURL is pressed |
55 | SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); | 55 | SEND_STRING("https://qmk.fm/\n"); |
56 | } else { | 56 | } else { |
57 | // when keycode QMKURL is released | 57 | // when keycode QMKURL is released |
58 | } | 58 | } |