1
0
Fork 0

Send string keycode tweaks (#7471)

This commit is contained in:
fauxpark 2019-11-26 18:16:58 +11:00 committed by Drashna Jaelre
parent a2cedf4555
commit 5a6737a778
10 changed files with 58 additions and 45 deletions

View file

@ -22,10 +22,10 @@ void matrix_scan_user(void) {
SEND_STRING("QMK is awesome.");
}
SEQ_TWO_KEYS(KC_D, KC_D) {
SEND_STRING(SS_LCTRL("a")SS_LCTRL("c"));
SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
}
SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
SEND_STRING("https://start.duckduckgo.com"SS_TAP(X_ENTER));
SEND_STRING("https://start.duckduckgo.com\n");
}
SEQ_TWO_KEYS(KC_A, KC_S) {
register_code(KC_LGUI);
@ -115,11 +115,11 @@ void matrix_scan_user(void) {
SEQ_ONE_KEY(KC_E) {
// Anything you can do in a macro.
SEND_STRING(SS_LCTRL(SS_LSFT("t")));
SEND_STRING(SS_LCTL(SS_LSFT("t")));
did_leader_succeed = true;
} else
SEQ_TWO_KEYS(KC_E, KC_D) {
SEND_STRING(SS_LGUI("r")"cmd"SS_TAP(KC_ENTER)SS_LCTRL("c"));
SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c"));
did_leader_succeed = true;
}
leader_end();

View file

@ -67,14 +67,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QMKURL:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
SEND_STRING("https://qmk.fm/\n");
} else {
// when keycode QMKURL is released
}
break;
case MY_OTHER_MACRO:
if (record->event.pressed) {
SEND_STRING(SS_LCTRL("ac")); // selects all and copies
SEND_STRING(SS_LCTL("ac")); // selects all and copies
}
break;
}
@ -109,18 +109,21 @@ Which would send "VE" followed by a `KC_HOME` tap, and "LO" (spelling "LOVE" if
There's also a couple of mod shortcuts you can use:
* `SS_LCTRL(string)`
* `SS_LGUI(string)`
* `SS_LALT(string)`
* `SS_LCTL(string)`
* `SS_LSFT(string)`
* `SS_RALT(string)`
* `SS_LALT(string)`
* `SS_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)`
* `SS_RCTL(string)`
* `SS_RSFT(string)`
* `SS_RALT(string)` or `SS_ALGR(string)`
* `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)`
These press the respective modifier, send the supplied string and then release the modifier.
They can be used like this:
SEND_STRING(SS_LCTRL("a"));
SEND_STRING(SS_LCTL("a"));
Which would send LCTRL+a (LCTRL down, a, LCTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
### Alternative Keymaps

View file

@ -208,15 +208,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
clear_mods(); clear_oneshot_mods();
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
#ifndef FLASH_BOOTLOADER
if ( (temp_mod | temp_osm) & MOD_MASK_SHIFT )
if ((temp_mod | temp_osm) & MOD_MASK_SHIFT)
#endif
{ //
{
SEND_STRING(":flash");
}
if ( (temp_mod | temp_osm) & MOD_MASK_CTRL) {
SEND_STRING(" -j8 --output-sync");
if ((temp_mod | temp_osm) & MOD_MASK_CTRL) {
SEND_STRING(" -j8 --output-sync");
}
SEND_STRING(SS_TAP(X_ENTER));
tap_code(KC_ENT);
set_mods(temp_mod);
}
break;