Refactor Leader key feature (#19632)

Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
Ryan
2023-02-13 03:19:02 +11:00
committed by GitHub
parent d10350cd2c
commit bbf7a20b33
77 changed files with 2457 additions and 1968 deletions

View File

@@ -1,14 +0,0 @@
LEADER_DICTIONARY() {
leading = false;
leader_end();
SEQ_ONE_KEY(TD(APMR_PIPE)) {
register_code(KC_LCTL);
register_code(KC_LSFT);
register_code(KC_U);
unregister_code(KC_U);
unregister_code(KC_LSFT);
unregister_code(KC_LCTL);
}
}

View File

@@ -1 +0,0 @@
LEADER_EXTERNS();

View File

@@ -1,5 +1,3 @@
#include "../leader/leader_setup.c"
bool MATRIX_SCANNED = false;
void matrix_scan_user(void) {
@@ -7,6 +5,16 @@ void matrix_scan_user(void) {
rgblight_sethsv_noeeprom(HSV_GREEN);
MATRIX_SCANNED = true;
}
#include "../leader/leader_dictionary.c"
};
void leader_end_user(void) {
if (leader_sequence_one_key(TD(APMR_PIPE))) {
register_code(KC_LCTL);
register_code(KC_LSFT);
register_code(KC_U);
unregister_code(KC_U);
unregister_code(KC_LSFT);
unregister_code(KC_LCTL);
}
}

View File

@@ -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);
}
}
}