summaryrefslogtreecommitdiff
path: root/quantum/send_string_keycodes.h
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-11-26 18:16:58 +1100
committerDrashna Jaelre <drashna@live.com>2019-11-25 23:16:58 -0800
commit5a6737a778cfa828e4fdb5d382a84a41e5210d8e (patch)
tree0c746428a46df925b30675990aca209f59db2d9d /quantum/send_string_keycodes.h
parenta2cedf4555ab417d849cbacf9562fd92407d5d71 (diff)
downloadqmk_firmware-5a6737a778cfa828e4fdb5d382a84a41e5210d8e.tar.gz
qmk_firmware-5a6737a778cfa828e4fdb5d382a84a41e5210d8e.zip
Send string keycode tweaks (#7471)
Diffstat (limited to 'quantum/send_string_keycodes.h')
-rw-r--r--quantum/send_string_keycodes.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/quantum/send_string_keycodes.h b/quantum/send_string_keycodes.h
index e2deb980ae..fc6467a741 100644
--- a/quantum/send_string_keycodes.h
+++ b/quantum/send_string_keycodes.h
@@ -340,3 +340,35 @@
#define X_MEDIA_REWIND bc
#define X_BRIGHTNESS_UP bd
#define X_BRIGHTNESS_DOWN be
+
+// Send string macros
+#define STRINGIZE(z) #z
+#define ADD_SLASH_X(y) STRINGIZE(\x##y)
+#define SYMBOL_STR(x) ADD_SLASH_X(x)
+
+#define SS_TAP_CODE 1
+#define SS_DOWN_CODE 2
+#define SS_UP_CODE 3
+
+#define SS_TAP(keycode) "\1" SYMBOL_STR(keycode)
+#define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode)
+#define SS_UP(keycode) "\3" SYMBOL_STR(keycode)
+
+// `string` arguments must not be parenthesized
+#define SS_LCTL(string) SS_DOWN(X_LCTL) string SS_UP(X_LCTL)
+#define SS_LSFT(string) SS_DOWN(X_LSFT) string SS_UP(X_LSFT)
+#define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT)
+#define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI)
+#define SS_LCMD(string) SS_LGUI(string)
+#define SS_LWIN(string) SS_LGUI(string)
+
+#define SS_RCTL(string) SS_DOWN(X_RCTL) string SS_UP(X_RCTL)
+#define SS_RSFT(string) SS_DOWN(X_RSFT) string SS_UP(X_RSFT)
+#define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT)
+#define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI)
+#define SS_ALGR(string) SS_RALT(string)
+#define SS_RCMD(string) SS_RGUI(string)
+#define SS_RWIN(string) SS_RGUI(string)
+
+// DEPRECATED
+#define SS_LCTRL(string) SS_LCTL(string)