Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
@@ -244,7 +244,30 @@ uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
}
|
||||
|
||||
LEADER_EXTERNS();
|
||||
void leader_end_user(void) {
|
||||
if (leader_sequence_one_key(KC_F)) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
if (leader_sequence_one_key(KC_S)) {
|
||||
SEND_STRING ("sudo -i\n");
|
||||
}
|
||||
if (leader_sequence_one_key(KC_H)) {
|
||||
SEND_STRING ("--help\n");
|
||||
}
|
||||
if (leader_sequence_two_keys(KC_D, KC_D)) {
|
||||
SEND_STRING(SS_LGUI("ac"));
|
||||
/* SEND_STRING(SS_LGUI("a") SS_LGUI("c")); */
|
||||
}
|
||||
if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) {
|
||||
SEND_STRING("https://start.duckduckgo.com\n");
|
||||
}
|
||||
if (leader_sequence_two_keys(KC_A, KC_S)) {
|
||||
register_code(KC_LGUI);
|
||||
register_code(KC_S);
|
||||
unregister_code(KC_S);
|
||||
unregister_code(KC_LGUI);
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (is_alt_tab_active) {
|
||||
@@ -253,31 +276,4 @@ void matrix_scan_user(void) {
|
||||
is_alt_tab_active = false;
|
||||
}
|
||||
}
|
||||
LEADER_DICTIONARY() {
|
||||
leading = false;
|
||||
leader_end();
|
||||
|
||||
SEQ_ONE_KEY(KC_F) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
SEQ_ONE_KEY(KC_S) {
|
||||
SEND_STRING ("sudo -i\n");
|
||||
}
|
||||
SEQ_ONE_KEY(KC_H) {
|
||||
SEND_STRING ("--help\n");
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_D, KC_D) {
|
||||
SEND_STRING(SS_LGUI("ac"));
|
||||
/* SEND_STRING(SS_LGUI("a") SS_LGUI("c")); */
|
||||
}
|
||||
SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
|
||||
SEND_STRING("https://start.duckduckgo.com\n");
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_A, KC_S) {
|
||||
register_code(KC_LGUI);
|
||||
register_code(KC_S);
|
||||
unregister_code(KC_S);
|
||||
unregister_code(KC_LGUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user