aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-05-29 11:58:08 -0400
committerGitHub <noreply@github.com>2017-05-29 11:58:08 -0400
commit1d6a18db99a91b059798a11a7820424d9b7c7b0c (patch)
tree7b708f1e8a36c473d41708052b167ed2350083a8 /docs
parentcecf783e145c4ca8e7737e8a1909bce946bc5a0f (diff)
parent91c6113cbabe01680d3dd473f8db64afaeec0bf6 (diff)
downloadqmk_firmware-1d6a18db99a91b059798a11a7820424d9b7c7b0c.tar.gz
qmk_firmware-1d6a18db99a91b059798a11a7820424d9b7c7b0c.zip
Merge pull request #1343 from Maartenwut/patch-1
Added SEND_STRING(); to the documentation.
Diffstat (limited to 'docs')
-rw-r--r--docs/Macros.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/Macros.md b/docs/Macros.md
index 78290bbf6..994d01928 100644
--- a/docs/Macros.md
+++ b/docs/Macros.md
@@ -195,3 +195,21 @@ For users of the earlier versions of dynamic macros: It is still possible to fin
195If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header). 195If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
196 196
197For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header. 197For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
198
199# Sending strings
200Some people want to have a password or some text on a key. This is possible without having to do every key individually using `SEND_STRING("<text>");`. Note the caps, because `send_string("<text>");` does something else. For example:
201```c
202const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
203{
204 switch(id) {
205 case 0: // this would trigger when you hit a key mapped as M(0)
206 if (record->event.pressed) {
207 SEND_STRING("QMK is the best thing ever!"); // This would type "QMK is the best thing ever!" (without quotation marks).
208 return false; // This is false because it has to return something.
209 }
210 break;
211 }
212 return MACRO_NONE;
213};
214```
215If you'd want it to press enter as well, just replace `return false;` with `return MACRO( T(ENT), END );`.