@ -8,34 +8,67 @@ Macros allow you to send multiple keystrokes when pressing just one key. QMK has
## The new way: `SEND_STRING()`&`process_record_user`
## The new way: `SEND_STRING()`&`process_record_user`
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string for you. All ascii that is easily translated to a keycode is supported (eg`\n\t`).
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string (i.e. a sequence of characters) for you. All ASCII characters that are easily translated to a keycode are supported (e.g.`\n\t`).
To activate this macro, assign the keycode `MY_CUSTOM_MACRO` to one of your keys in your keymap.
What happens here is this:
We first define a new custom keycode in the range not occupied by any other keycodes.
Then we use the `process_record_user` function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated.
If yes, we send the string `"QMK is the best thing ever!"` to the computer via the `SEND_STRING` macro (this is a C preprocessor macro, not to be confused with QMK macros).
We return `false` to indicate to the caller that the key press we just processed need not be processed any further.
You might want to add more than one macro.
You can do that by adding another keycode and adding another case to the switch statement, like so: