diff options
author | Ryan <fauxpark@gmail.com> | 2023-02-13 03:19:02 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-13 03:19:02 +1100 |
commit | bbf7a20b33de2d203518687cb5cd1aa85005ea27 (patch) | |
tree | ee1a5c412a02021d085c81a26321c3424eca7022 /keyboards | |
parent | d10350cd2ceb2b9d80522cdec3ea908118f7fd35 (diff) |
Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards')
36 files changed, 963 insertions, 1206 deletions
diff --git a/keyboards/7c8/framework/keymaps/steven/keymap.c b/keyboards/7c8/framework/keymaps/steven/keymap.c index f39be10c2d..5cba63e0fa 100644 --- a/keyboards/7c8/framework/keymaps/steven/keymap.c +++ b/keyboards/7c8/framework/keymaps/steven/keymap.c @@ -78,42 +78,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // qq, alt+f4 close window - SEQ_TWO_KEYS(KC_Q, KC_Q) { - tap_code16(A(KC_F4)); - } +void leader_end_user(void) { + // qq, alt+f4 close window + if (leader_sequence_two_keys(KC_Q, KC_Q)) { + tap_code16(A(KC_F4)); + } - // ee, open explorer - SEQ_TWO_KEYS(KC_E, KC_E) { - tap_code16(G(KC_E)); - } + // ee, open explorer + if (leader_sequence_two_keys(KC_E, KC_E)) { + tap_code16(G(KC_E)); + } - // rr, windows run prompt - SEQ_TWO_KEYS(KC_R, KC_R) { - tap_code16(G(KC_R)); - } + // rr, windows run prompt + if (leader_sequence_two_keys(KC_R, KC_R)) { + tap_code16(G(KC_R)); + } - // ww, maximize window - SEQ_TWO_KEYS(KC_W, KC_W) { - tap_code16(G(KC_UP)); - } + // ww, maximize window + if (leader_sequence_two_keys(KC_W, KC_W)) { + tap_code16(G(KC_UP)); + } - // ss, minimize window - SEQ_TWO_KEYS(KC_S, KC_S) { - tap_code16(G(KC_DOWN)); - } + // ss, minimize window + if (leader_sequence_two_keys(KC_S, KC_S)) { + tap_code16(G(KC_DOWN)); + } - // <space><space>, toggle desktop - SEQ_TWO_KEYS(KC_SPC, KC_SPC) { - tap_code16(G(KC_D)); - } + // <space><space>, toggle desktop + if (leader_sequence_two_keys(KC_SPC, KC_SPC)) { + tap_code16(G(KC_D)); } } diff --git a/keyboards/dz60/keymaps/jdelkins/keymap.c b/keyboards/dz60/keymaps/jdelkins/keymap.c index 5555a0113f..2a989fe545 100644 --- a/keyboards/dz60/keymaps/jdelkins/keymap.c +++ b/keyboards/dz60/keymaps/jdelkins/keymap.c @@ -229,7 +229,47 @@ void keyboard_post_init_keymap(void) { bspc_timer = 0; } -LEADER_EXTERNS(); +void leader_end_user(void) { + // layer navigation + if (leader_sequence_one_key(KC_R)) { layer_invert(_RPT); } + if (leader_sequence_one_key(KC_G)) { layer_invert(_GAME); } + if (leader_sequence_one_key(KC_K)) { layer_invert(_KP); } + if (leader_sequence_one_key(KC_KP_5)) { layer_invert(_KP); } + + // tmux navigation + if (leader_sequence_one_key(KC_L)) { SEND_STRING(SS_LCTL("a") "n"); } + if (leader_sequence_one_key(KC_H)) { SEND_STRING(SS_LCTL("a") "p"); } + if (leader_sequence_one_key(KC_N)) { SEND_STRING(SS_LCTL("a") "c"); } + if (leader_sequence_one_key(KC_W)) { SEND_STRING(SS_LCTL("a") "x"); } + if (leader_sequence_one_key(KC_MINS)) { SEND_STRING(SS_LCTL("a") "-"); } + if (leader_sequence_one_key(KC_QUOT)) { SEND_STRING(SS_LCTL("a") "\""); } + if (leader_sequence_one_key(KC_1)) { SEND_STRING(SS_LCTL("a") "1"); } + if (leader_sequence_one_key(KC_2)) { SEND_STRING(SS_LCTL("a") "2"); } + if (leader_sequence_one_key(KC_3)) { SEND_STRING(SS_LCTL("a") "3"); } + if (leader_sequence_one_key(KC_4)) { SEND_STRING(SS_LCTL("a") "4"); } + if (leader_sequence_one_key(KC_5)) { SEND_STRING(SS_LCTL("a") "5"); } + if (leader_sequence_one_key(KC_6)) { SEND_STRING(SS_LCTL("a") "6"); } + if (leader_sequence_one_key(KC_7)) { SEND_STRING(SS_LCTL("a") "7"); } + if (leader_sequence_one_key(KC_8)) { SEND_STRING(SS_LCTL("a") "8"); } + if (leader_sequence_one_key(KC_9)) { SEND_STRING(SS_LCTL("a") "9"); } + + // secrets + if (leader_sequence_two_keys(KC_SCLN, KC_M)) { send_secret_string(0); } + if (leader_sequence_two_keys(KC_SCLN, KC_COMM)) { send_secret_string(1); } + if (leader_sequence_two_keys(KC_SCLN, KC_DOT)) { send_secret_string(2); } + if (leader_sequence_two_keys(KC_SCLN, KC_J)) { send_secret_string(3); } + if (leader_sequence_two_keys(KC_SCLN, KC_K)) { send_secret_string(4); } + if (leader_sequence_two_keys(KC_SCLN, KC_L)) { send_secret_string(5); } + + // fast control-C + if (leader_sequence_one_key(KC_C)) { tap_code16(C(KC_C)); } + + // neovim: terminal escape + if (leader_sequence_one_key(KC_BSLS)) { + tap_code16(C(KC_BSLS)); + tap_code16(C(KC_N)); + } +} void matrix_scan_keymap(void) { if (rgblight_is_enabled() && timer_elapsed(rgb_timer) > 1000) { @@ -248,50 +288,6 @@ void matrix_scan_keymap(void) { bspc_timer = 0; register_code(KC_BSPC); } - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // layer navigation - SEQ_ONE_KEY(KC_R) { layer_invert(_RPT); } - SEQ_ONE_KEY(KC_G) { layer_invert(_GAME); } - SEQ_ONE_KEY(KC_K) { layer_invert(_KP); } - SEQ_ONE_KEY(KC_KP_5) { layer_invert(_KP); } - - // tmux navigation - SEQ_ONE_KEY(KC_L) { SEND_STRING(SS_LCTL("a") "n"); } - SEQ_ONE_KEY(KC_H) { SEND_STRING(SS_LCTL("a") "p"); } - SEQ_ONE_KEY(KC_N) { SEND_STRING(SS_LCTL("a") "c"); } - SEQ_ONE_KEY(KC_W) { SEND_STRING(SS_LCTL("a") "x"); } - SEQ_ONE_KEY(KC_MINS) { SEND_STRING(SS_LCTL("a") "-"); } - SEQ_ONE_KEY(KC_QUOT) { SEND_STRING(SS_LCTL("a") "\""); } - SEQ_ONE_KEY(KC_1) { SEND_STRING(SS_LCTL("a") "1"); } - SEQ_ONE_KEY(KC_2) { SEND_STRING(SS_LCTL("a") "2"); } - SEQ_ONE_KEY(KC_3) { SEND_STRING(SS_LCTL("a") "3"); } - SEQ_ONE_KEY(KC_4) { SEND_STRING(SS_LCTL("a") "4"); } - SEQ_ONE_KEY(KC_5) { SEND_STRING(SS_LCTL("a") "5"); } - SEQ_ONE_KEY(KC_6) { SEND_STRING(SS_LCTL("a") "6"); } - SEQ_ONE_KEY(KC_7) { SEND_STRING(SS_LCTL("a") "7"); } - SEQ_ONE_KEY(KC_8) { SEND_STRING(SS_LCTL("a") "8"); } - SEQ_ONE_KEY(KC_9) { SEND_STRING(SS_LCTL("a") "9"); } - - // secrets - SEQ_TWO_KEYS(KC_SCLN, KC_M) { send_secret_string(0); } - SEQ_TWO_KEYS(KC_SCLN, KC_COMM) { send_secret_string(1); } - SEQ_TWO_KEYS(KC_SCLN, KC_DOT) { send_secret_string(2); } - SEQ_TWO_KEYS(KC_SCLN, KC_J) { send_secret_string(3); } - SEQ_TWO_KEYS(KC_SCLN, KC_K) { send_secret_string(4); } - SEQ_TWO_KEYS(KC_SCLN, KC_L) { send_secret_string(5); } - - // fast control-C - SEQ_ONE_KEY(KC_C) { tap_code16(C(KC_C)); } - - // neovim: terminal escape - SEQ_ONE_KEY(KC_BSLS) { - tap_code16(C(KC_BSLS)); - tap_code16(C(KC_N)); - } - } } bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c index f98873f3df..3870c6aae3 100644 --- a/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c +++ b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c @@ -418,54 +418,52 @@ void ldrkey_send_curlybrace_wrap_selection(void) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LGUI(SS_TAP(X_V)) SS_TAP(X_RIGHT)) : SEND_STRING(SS_LCTL(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LCTL(SS_TAP(X_V)) SS_TAP(X_RIGHT)); } -LEADER_EXTERNS(); +void leader_start_user(void) { + isLeader = true; +} -void matrix_scan_user(void) -{ - LEADER_DICTIONARY() - { - leading = false; - leader_end(); +void leader_end_user(void) { + isLeader = false; - /* Sequences on layer _MAIN & _MAC */ + /* Sequences on layer _MAIN & _MAC */ /* éÉ => LdrKey > / */ - SEQ_ONE_KEY(KC_SLSH) { + if (leader_sequence_one_key(KC_SLSH)) { send_french_accent(_E, _ACUTE); } /* àÀ => LdrKey > A */ - SEQ_ONE_KEY(KC_A) { + if (leader_sequence_one_key(KC_A)) { send_french_accent(_A, _GRAVE); } /* èÈ => LdrKey > E */ - SEQ_ONE_KEY(KC_E) { + if (leader_sequence_one_key(KC_E)) { send_french_accent(_E, _GRAVE); } /* ùÙ => LdrKey > U */ - SEQ_ONE_KEY(KC_U) { + if (leader_sequence_one_key(KC_U)) { send_french_accent(_U, _GRAVE); } /* â => LdrKey > A > A */ - SEQ_TWO_KEYS(KC_A, KC_A) { + if (leader_sequence_two_keys(KC_A, KC_A)) { send_french_accent(_A, _CIRCUMFLEX); } /* êÊ => LdrKey > E > E */ - SEQ_TWO_KEYS(KC_E, KC_E) { + if (leader_sequence_two_keys(KC_E, KC_E)) { send_french_accent(_E, _CIRCUMFLEX); } /* îÎ => LdrKey > I > I */ - SEQ_TWO_KEYS(KC_I, KC_I) { + if (leader_sequence_two_keys(KC_I, KC_I)) { send_french_accent(_I, _CIRCUMFLEX); } /* ôÔ => LdrKey > O > O */ - SEQ_TWO_KEYS(KC_O, KC_O) { + if (leader_sequence_two_keys(KC_O, KC_O)) { send_french_accent(_O, _CIRCUMFLEX); } /* ûÛ => LdrKey > U > U */ - SEQ_TWO_KEYS(KC_U, KC_U) { + if (leader_sequence_two_keys(KC_U, KC_U)) { send_french_accent(_U, _CIRCUMFLEX); } /* çÇ => LdrKey > C */ - SEQ_ONE_KEY(KC_C) { + if (leader_sequence_one_key(KC_C)) { if (onMac) { SEND_STRING(SS_LALT("c")); } else { @@ -473,247 +471,238 @@ void matrix_scan_user(void) } } /* CapsLock */ - SEQ_ONE_KEY(QK_LEAD) { + if (leader_sequence_one_key(QK_LEAD)) { tap_code(KC_CAPS); } /* ± => LdrKey > = > - */ - SEQ_TWO_KEYS(KC_EQL, KC_MINS) { + if (leader_sequence_two_keys(KC_EQL, KC_MINS)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_EQL)))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P1) SS_UP(X_LALT)); } /* ≤ => LdrKey > - > = */ - SEQ_TWO_KEYS(KC_MINS, KC_EQL) { + if (leader_sequence_two_keys(KC_MINS, KC_EQL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_COMM))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P3) SS_UP(X_LALT)); } /* ≥ => LdrKey > = > = */ - SEQ_TWO_KEYS(KC_EQL, KC_EQL) { + if (leader_sequence_two_keys(KC_EQL, KC_EQL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_DOT))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P2) SS_UP(X_LALT)); } /* <= => LdrKey > , > , */ - SEQ_TWO_KEYS(KC_COMM, KC_COMM) { + if (leader_sequence_two_keys(KC_COMM, KC_COMM)) { SEND_STRING(SS_LSFT(SS_TAP(X_COMM)) SS_TAP(X_SPC) SS_TAP(X_EQL) SS_TAP(X_LEFT) SS_TAP(X_BSPC) SS_TAP(X_RIGHT)); } /* => => LdrKey > . > . */ - SEQ_TWO_KEYS(KC_DOT, KC_DOT) { + if (leader_sequence_two_keys(KC_DOT, KC_DOT)) { SEND_STRING("=>"); } /* ", " => LdrKey > " " */ - SEQ_ONE_KEY(KC_SPC) { + if (leader_sequence_one_key(KC_SPC)) { SEND_STRING(", "); } /* ". " => LdrKey > " " > " " */ - SEQ_TWO_KEYS(KC_SPC, KC_SPC) { + if (leader_sequence_two_keys(KC_SPC, KC_SPC)) { SEND_STRING(". "); } /* Backward delete current word (on cursor) */ - SEQ_TWO_KEYS(KC_BSPC, KC_BSPC) { + if (leader_sequence_two_keys(KC_BSPC, KC_BSPC)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_RIGHT)) SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT)) SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)); } /* Previous word delete */ - SEQ_ONE_KEY(KC_BSPC) { + if (leader_sequence_one_key(KC_BSPC)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)); } /* Forward delete current word (on cursor) */ - SEQ_TWO_KEYS(KC_DEL, KC_DEL) { + if (leader_sequence_two_keys(KC_DEL, KC_DEL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)) : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)); } /* Next word delete */ - SEQ_ONE_KEY(KC_DEL) { + if (leader_sequence_one_key(KC_DEL)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)): SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)); } /* ` => LdrKey > Escape */ - SEQ_ONE_KEY(QK_GESC) { + if (leader_sequence_one_key(QK_GESC)) { SEND_STRING("`"); } /* ``` => LdrKey > Escape > Escape > Escape */ - SEQ_THREE_KEYS(QK_GESC, QK_GESC, QK_GESC) { + if (leader_sequence_three_keys(QK_GESC, QK_GESC, QK_GESC)) { SEND_STRING("```"); } /* Printscreen => LdrKey > Insert */ - SEQ_ONE_KEY(KC_INS) { + if (leader_sequence_one_key(KC_INS)) { onMac ? SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))) : SEND_STRING(SS_TAP(X_PSCR)); } /* Home => LdrKey > Page Up */ - SEQ_ONE_KEY(KC_PGUP) { + if (leader_sequence_one_key(KC_PGUP)) { onMac ? SEND_STRING(SS_TAP(X_HOME)) : SEND_STRING(SS_LCTL(SS_TAP(X_HOME))); } /* End => LdrKey > Page Down */ - SEQ_ONE_KEY(KC_PGDN) { + if (leader_sequence_one_key(KC_PGDN)) { onMac ? SEND_STRING(SS_TAP(X_END)) : SEND_STRING(SS_LCTL(SS_TAP(X_END))); } /* Close Curernt File/Tab => LdrKey > W */ - SEQ_ONE_KEY(KC_W) { + if (leader_sequence_one_key(KC_W)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_W))) : SEND_STRING(SS_LCTL(SS_TAP(X_W))); } /* Close Current App => LdrKey > Q */ - SEQ_ONE_KEY(KC_Q) { + if (leader_sequence_one_key(KC_Q)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_Q))) : SEND_STRING(SS_LALT(SS_TAP(X_F4))); } /* " => LdrKey > ' */ - SEQ_ONE_KEY(KC_QUOT) { + if (leader_sequence_one_key(KC_QUOT)) { SEND_STRING("\""); } /* "|" => LdrKey > ' > ' */ - SEQ_TWO_KEYS(KC_QUOT, KC_QUOT) { + if (leader_sequence_two_keys(KC_QUOT, KC_QUOT)) { SEND_STRING("\"\"" SS_TAP(X_LEFT)); } /* "X" wrap => LdrKey > ' > ' > ' */ - SEQ_THREE_KEYS(KC_QUOT, KC_QUOT, KC_QUOT) { + if (leader_sequence_three_keys(KC_QUOT, KC_QUOT, KC_QUOT)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "\"" SS_LALT(SS_TAP(X_RIGHT)) "\"") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "\"" SS_LCTL(SS_TAP(X_RIGHT)) "\""); } /* ( => LdrKey > Left Shift */ - SEQ_ONE_KEY(KC_LSFT) { + if (leader_sequence_one_key(KC_LSFT)) { SEND_STRING("("); } /* ) => LdrKey > Right Shift */ - SEQ_ONE_KEY(KC_RSFT) { + if (leader_sequence_one_key(KC_RSFT)) { SEND_STRING(")"); } /* (|) => LdrKey > Left Shift > Left Shift */ - SEQ_TWO_KEYS(KC_LSFT, KC_LSFT) { + if (leader_sequence_two_keys(KC_LSFT, KC_LSFT)) { ldrkey_send_paranthesis_wrap_ini(); } /* (|) => LdrKey > Right Shift > Right Shift */ - SEQ_TWO_KEYS(KC_RSFT, KC_RSFT) { + if (leader_sequence_two_keys(KC_RSFT, KC_RSFT)) { ldrkey_send_paranthesis_wrap_ini(); } /* (X) wrap => LdrKey > Left Shift > W */ - SEQ_TWO_KEYS(KC_LSFT, KC_W) { + if (leader_sequence_two_keys(KC_LSFT, KC_W)) { ldrkey_send_paranthesis_wrap_word(); } /* (X) wrap => LdrKey > Right Shift > W */ - SEQ_TWO_KEYS(KC_RSFT, KC_W) { + if (leader_sequence_two_keys(KC_RSFT, KC_W)) { ldrkey_send_paranthesis_wrap_word(); } /* (X) wrap selection => LdrKey > Left Shift > W > W */ - SEQ_THREE_KEYS(KC_LSFT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LSFT, KC_W, KC_W)) { ldrkey_send_paranthesis_wrap_selection(); } /* (X) wrap selection => LdrKey > Right Shift > W > W */ - SEQ_THREE_KEYS(KC_RSFT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RSFT, KC_W, KC_W)) { ldrkey_send_paranthesis_wrap_selection(); } /* [ => LdrKey > Left CTL */ - SEQ_ONE_KEY(KC_LCTL) { + if (leader_sequence_one_key(KC_LCTL)) { SEND_STRING("["); } /* ] => LdrKey > Right CTL */ - SEQ_ONE_KEY(KC_RCTL) { + if (leader_sequence_one_key(KC_RCTL)) { SEND_STRING("]"); } /* [|] => LdrKey > Left CTL > Left CTL */ - SEQ_TWO_KEYS(KC_LCTL, KC_LCTL) { + if (leader_sequence_two_keys(KC_LCTL, KC_LCTL)) { ldrkey_send_bracket_wrap_ini(); } /* [|] => LdrKey > Right CTL > Right CTL */ - SEQ_TWO_KEYS(KC_RCTL, KC_RCTL) { + if (leader_sequence_two_keys(KC_RCTL, KC_RCTL)) { ldrkey_send_bracket_wrap_ini(); } /* [X] wrap => LdrKey > Left CTL > W */ - SEQ_TWO_KEYS(KC_LCTL, KC_W) { + if (leader_sequence_two_keys(KC_LCTL, KC_W)) { ldrkey_send_bracket_wrap_word(); } /* [X] wrap => LdrKey > Right CTL > W */ - SEQ_TWO_KEYS(KC_RCTL, KC_W) { + if (leader_sequence_two_keys(KC_RCTL, KC_W)) { ldrkey_send_bracket_wrap_word(); } /* [X] wrap selection => LdrKey > Left CTL > W > W */ - SEQ_THREE_KEYS(KC_LCTL, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LCTL, KC_W, KC_W)) { ldrkey_send_bracket_wrap_selection(); } /* [X] wrap selection => LdrKey > Right CTL > W > W */ - SEQ_THREE_KEYS(KC_RCTL, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RCTL, KC_W, KC_W)) { ldrkey_send_bracket_wrap_selection(); } /* { => LdrKey > Left ALT */ - SEQ_ONE_KEY(KC_LALT) { + if (leader_sequence_one_key(KC_LALT)) { SEND_STRING("{"); } /* } => LdrKey > Right ALT */ - SEQ_ONE_KEY(KC_RALT) { + if (leader_sequence_one_key(KC_RALT)) { SEND_STRING("}"); } /* {|} => LdrKey > Left ALT > Left ALT */ - SEQ_TWO_KEYS(KC_LALT, KC_LALT) { + if (leader_sequence_two_keys(KC_LALT, KC_LALT)) { ldrkey_send_curlybrace_wrap_ini(); } /* {|} => LdrKey > Right ALT > Right ALT */ - SEQ_TWO_KEYS(KC_RALT, KC_RALT) { + if (leader_sequence_two_keys(KC_RALT, KC_RALT)) { ldrkey_send_curlybrace_wrap_ini(); } /* {X} wrap => LdrKey > Left ALT > W */ - SEQ_TWO_KEYS(KC_LALT, KC_W) { + if (leader_sequence_two_keys(KC_LALT, KC_W)) { ldrkey_send_curlybrace_wrap_word(); } /* {X} wrap => LdrKey > Right ALT > W */ - SEQ_TWO_KEYS(KC_RALT, KC_W) { + if (leader_sequence_two_keys(KC_RALT, KC_W)) { ldrkey_send_curlybrace_wrap_word(); } /* {X} wrap selection => LdrKey > Left ALT > W > W */ - SEQ_THREE_KEYS(KC_LALT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LALT, KC_W, KC_W)) { ldrkey_send_curlybrace_wrap_selection(); } /* {X} wrap selection => LdrKey > Right ALT > W > W */ - SEQ_THREE_KEYS(KC_RALT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RALT, KC_W, KC_W)) { ldrkey_send_curlybrace_wrap_selection(); } /* Select everything on this line before cursor => LdrKey > Left */ - SEQ_ONE_KEY(KC_LEFT) { + if (leader_sequence_one_key(KC_LEFT)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_LEFT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_HOME))); } /* Select everything on this line after cursor => LdrKey > Right */ - SEQ_ONE_KEY(KC_RIGHT) { + if (leader_sequence_one_key(KC_RIGHT)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_END))); } /* Select everything on this line before cursor and bring on previous line => LdrKey > Left > Left */ - SEQ_TWO_KEYS(KC_LEFT, KC_LEFT) { + if (leader_sequence_two_keys(KC_LEFT, KC_LEFT)) { onMac ? SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_TAP(X_END))); } /* Select everything on this line => LdrKey > Right > Left */ - SEQ_TWO_KEYS(KC_RIGHT, KC_LEFT) { + if (leader_sequence_two_keys(KC_RIGHT, KC_LEFT)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_RIGHT) SS_LSFT(SS_LGUI(SS_TAP(X_LEFT))))) : SEND_STRING(SS_TAP(X_END) SS_LSFT(SS_TAP(X_HOME))); } /* Select 1x Page Up on the page before the cursor => LdrKey > Up */ - SEQ_ONE_KEY(KC_UP) { + if (leader_sequence_one_key(KC_UP)) { SEND_STRING(SS_LSFT(SS_TAP(X_PGUP))); } /* Select 1x Page Down on the page after the cursor => LdrKey > Down */ - SEQ_ONE_KEY(KC_DOWN) { + if (leader_sequence_one_key(KC_DOWN)) { SEND_STRING(SS_LSFT(SS_TAP(X_PGDN))); } /* Select everything on the page before the cursor => LdrKey > Up > Up */ - SEQ_TWO_KEYS(KC_UP, KC_UP) { + if (leader_sequence_two_keys(KC_UP, KC_UP)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_UP)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_HOME)))); } /* Select everything on the page after the cursor => LdrKey > Down > Down */ - SEQ_TWO_KEYS(KC_DOWN, KC_DOWN) { + if (leader_sequence_two_keys(KC_DOWN, KC_DOWN)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_DOWN)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_END)))); } /* HELPER => spit out the url of the layout description page on github */ - SEQ_FIVE_KEYS(QK_GESC, QK_GESC, QK_GESC, QK_GESC, QK_GESC) { + if (leader_sequence_five_keys(QK_GESC, QK_GESC, QK_GESC, QK_GESC, QK_GESC)) { SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/keyboards/dztech/dz65rgb/keymaps/drootz"); } /* google.ca => LdrKey > G > G */ - SEQ_TWO_KEYS(KC_G, KC_G) { + if (leader_sequence_two_keys(KC_G, KC_G)) { SEND_STRING("https://google.ca" SS_TAP(X_ENT)); } /* @gmail => LdrKey > M > L > T */ - SEQ_THREE_KEYS(KC_M, KC_L, KC_T) { + if (leader_sequence_three_keys(KC_M, KC_L, KC_T)) { SEND_STRING("mailto." SS_TAP(X_D) SS_TAP(X_A) SS_TAP(X_N) SS_TAP(X_I) SS_TAP(X_E) SS_TAP(X_L) SS_TAP(X_R) SS_TAP(X_A) SS_TAP(X_C) SS_TAP(X_I) SS_TAP(X_N) SS_TAP(X_E) "@gmail.com"); } /* Show Desktop => LdrKey > D */ - SEQ_ONE_KEY(KC_D) { + if (leader_sequence_one_key(KC_D)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_SPC)) "Mission" SS_TAP(X_ENT)) : SEND_STRING(SS_LGUI(SS_TAP(X_D))); } - } -} - -void leader_start_user(void) { - isLeader = true; -} - -void leader_end_user(void) { - isLeader = false; } #endif /* LEADER */ diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c deleted file mode 100644 index 8d5fa00a7d..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c +++ /dev/null @@ -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); - } -} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c deleted file mode 100644 index c22670a05a..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c +++ /dev/null @@ -1 +0,0 @@ -LEADER_EXTERNS(); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c index 277821afac..fc6c99cb85 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c @@ -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); + } +} diff --git a/keyboards/ergodox_ez/keymaps/stamm/keymap.c b/keyboards/ergodox_ez/keymaps/stamm/keymap.c index 8a3e30f5f6..21f58b298c 100644 --- a/keyboards/ergodox_ez/keymaps/stamm/keymap.c +++ b/keyboards/ergodox_ez/keymaps/stamm/keymap.c @@ -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); - } - } } diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c index 885c31e8c6..1d49d91346 100644 --- a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c +++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c @@ -49,89 +49,69 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -void matrix_init_user(void) { - -} - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Close a program in i3wm - SEQ_ONE_KEY(KC_Q) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_Q); - unregister_code(KC_Q); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); - } - // Exit i3wm - SEQ_ONE_KEY(KC_E) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_E); - unregister_code(KC_E); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); - } - // Copy selected text in suckless terminal - SEQ_ONE_KEY(KC_C) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - // Paste text in suckless terminal - SEQ_ONE_KEY(KC_V) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_V); - unregister_code(KC_V); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - // FZF shortcut to fuzzy switch directories - SEQ_ONE_KEY(KC_D) { - register_code(KC_LALT); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LALT); - } - // Send keys to bring up fuzzy process kill - SEQ_ONE_KEY(KC_K) { - SEND_STRING("kill " SS_TAP(X_TAB)); - } - // Send keys to start neovim and fuzzy search for filename - SEQ_ONE_KEY(KC_T) { - SEND_STRING("nvim "); - register_code(KC_LCTL); - register_code(KC_T); - unregister_code(KC_T); - unregister_code(KC_LCTL); - } - // Switch between windows in tmux - SEQ_ONE_KEY(KC_L) { - register_code(KC_LCTL); - register_code(KC_B); - unregister_code(KC_B); - unregister_code(KC_LCTL); - register_code(KC_L); - unregister_code(KC_L); - } +void leader_end_user() { + // Close a program in i3wm + if (leader_sequence_one_key(KC_Q)) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_Q); + unregister_code(KC_Q); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + // Exit i3wm + if (leader_sequence_one_key(KC_E)) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_E); + unregister_code(KC_E); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + // Copy selected text in suckless terminal + if (leader_sequence_one_key(KC_C)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + // Paste text in suckless terminal + if (leader_sequence_one_key(KC_V)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_V); + unregister_code(KC_V); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + // FZF shortcut to fuzzy switch directories + if (leader_sequence_one_key(KC_D)) { + register_code(KC_LALT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LALT); + } + // Send keys to bring up fuzzy process kill + if (leader_sequence_one_key(KC_K)) { + SEND_STRING("kill " SS_TAP(X_TAB)); + } + // Send keys to start neovim and fuzzy search for filename + if (leader_sequence_one_key(KC_T)) { + SEND_STRING("nvim "); + register_code(KC_LCTL); + register_code(KC_T); + unregister_code(KC_T); + unregister_code(KC_LCTL); + } + // Switch between windows in tmux + if (leader_sequence_one_key(KC_L)) { + register_code(KC_LCTL); + register_code(KC_B); + unregister_code(KC_B); + unregister_code(KC_LCTL); + register_code(KC_L); + unregister_code(KC_L); } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - } diff --git a/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c b/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c index 1b8e41de0e..1852920345 100644 --- a/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c +++ b/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c @@ -42,25 +42,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LEFT, KC_RGHT, _______, KC_PENT, _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)}; - -/*void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_RSFT) { - register_code(KC_S); - unregister_code(KC_S); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_H); - unregister_code(KC_H); - } - SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); - } - } -}*/ diff --git a/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c index c33bf71741..c030738400 100644 --- a/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c +++ b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c @@ -181,15 +181,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_U) { - SEND_STRING(":luvu:\n"); +void leader_end_user(void) { + if (leader_sequence_one_key(KC_U)) { + SEND_STRING(":luvu:\n"); } - } } diff --git a/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c index be1edfc019..a345e075d9 100644 --- a/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c +++ b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c @@ -255,38 +255,29 @@ L06 -> <TBD>: UNSPECIFIED }; +void leader_end_user(void) { + if (leader_sequence_one_key(KC_1)) { + // ¯\_(ツ)_/¯ + unicode_input_start(); register_hex(0xaf); unicode_input_finish(); + register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + } + + if (leader_sequence_one_key(KC_2)) { + // 凸(ツ)凸 + unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); + } +} + // Runs just one time when the keyboard initializes. void matrix_init_user(void) { set_unicode_input_mode(UNICODE_MODE_LINUX); }; - - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY (KC_1) { - // ¯\_(ツ)_/¯ - unicode_input_start(); register_hex(0xaf); unicode_input_finish(); - register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); - register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0xaf); unicode_input_finish(); - } - - SEQ_ONE_KEY (KC_2) { - // 凸(ツ)凸 - unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); - } - } -} diff --git a/keyboards/keebio/iris/keymaps/omgvee/keymap.c b/keyboards/keebio/iris/keymaps/omgvee/keymap.c index 4276938b8d..035d381bac 100644 --- a/keyboards/keebio/iris/keymaps/omgvee/keymap.c +++ b/keyboards/keebio/iris/keymaps/omgvee/keymap.c @@ -32,9 +32,6 @@ enum custom_keycodes { #define MW_L KC_MS_WH_LEFT #define MW_R KC_MS_WH_RIGHT -//// only uncomment the below line when you enable leader key in rules.mk -//LEADER_EXTERNS(); - //Tap Dance Declarations enum { TD_SCL = 0 diff --git a/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c b/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c index 9cfc26d138..b97e6bfb92 100644 --- a/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c @@ -76,68 +76,62 @@ static bool wiggle_mouse; static uint16_t wiggle_timer; static uint16_t next_wiggle; +void leader_end_user(void) { + if (leader_sequence_one_key(QK_LEAD)) { + tap_code(KC_CAPS); + } -LEADER_EXTERNS(); + if (leader_sequence_four_keys(KC_I, KC_D, KC_L, KC_E)) { + wiggle_mouse = !wiggle_mouse; + wiggle_timer = timer_read(); + } -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(QK_LEAD) { - tap_code(KC_CAPS); - } - - SEQ_FOUR_KEYS(KC_I, KC_D, KC_L, KC_E) { - wiggle_mouse = !wiggle_mouse; - wiggle_timer = timer_read(); - } - - SEQ_TWO_KEYS(KC_O, KC_K) { - send_unicode_string("👍"); - } - - SEQ_THREE_KEYS(KC_S, KC_A, KC_D) { - send_unicode_string("😞"); - } - - SEQ_FIVE_KEYS(KC_C, KC_H, KC_E, KC_C, KC_K) { - send_unicode_string("✅"); - } - - SEQ_FIVE_KEYS(KC_C, KC_R, KC_O, KC_S, KC_S) { - send_unicode_string("❎"); - } - - SEQ_FIVE_KEYS(KC_T, KC_H, KC_A, KC_N, KC_K) { - send_unicode_string("🙏"); - } - - SEQ_FIVE_KEYS(KC_S, KC_M, KC_I, KC_L, KC_E) { - send_unicode_string("😊"); - } - - SEQ_FIVE_KEYS(KC_P, KC_A, KC_R, KC_T, KC_Y) { - send_unicode_string("🎉"); - } - - SEQ_FOUR_KEYS(KC_E, KC_Y, KC_E, KC_S) { - send_unicode_string("(ಠ_ಠ)"); - } - - SEQ_FIVE_KEYS(KC_M, KC_A, KC_G, KC_I, KC_C) { - send_unicode_string("(ಠ_ಠ) 🪄 ⠁⭒*.✫.*⭒⠁"); - } - - SEQ_FIVE_KEYS(KC_T, KC_A, KC_B, KC_L, KC_E) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - - SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) { - send_unicode_string("¯\\_(ツ)_/¯"); - } + if (leader_sequence_two_keys(KC_O, KC_K)) { + send_unicode_string("👍"); + } + + if (leader_sequence_three_keys(KC_S, KC_A, KC_D)) { + send_unicode_string("😞"); + } + + if (leader_sequence_five_keys(KC_C, KC_H, KC_E, KC_C, KC_K)) { + send_unicode_string("✅"); + } + + if (leader_sequence_five_keys(KC_C, KC_R, KC_O, KC_S, KC_S)) { + send_unicode_string("❎"); + } + + if (leader_sequence_five_keys(KC_T, KC_H, KC_A, KC_N, KC_K)) { + send_unicode_string("🙏"); + } + + if (leader_sequence_five_keys(KC_S, KC_M, KC_I, KC_L, KC_E)) { + send_unicode_string("😊"); + } + + if (leader_sequence_five_keys(KC_P, KC_A, KC_R, KC_T, KC_Y)) { + send_unicode_string("🎉"); + } + + if (leader_sequence_four_keys(KC_E, KC_Y, KC_E, KC_S)) { + send_unicode_string("(ಠ_ಠ)"); + } + + if (leader_sequence_five_keys(KC_M, KC_A, KC_G, KC_I, KC_C)) { + send_unicode_string("(ಠ_ಠ) 🪄 ⠁⭒*.✫.*⭒⠁"); } + if (leader_sequence_five_keys(KC_T, KC_A, KC_B, KC_L, KC_E)) { + send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); + } + + if (leader_sequence_five_keys(KC_S, KC_H, KC_R, KC_U, KC_G)) { + send_unicode_string("¯\\_(ツ)_/¯"); + } +} + +void matrix_scan_user(void) { if (wiggle_mouse && timer_elapsed(wiggle_timer) > next_wiggle) { wiggle_timer = timer_read(); diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c index a2719798de..03d1ddabed 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c @@ -446,27 +446,18 @@ bool rgb_matrix_indicators_user(void) { return false; } -#ifdef LEADER_ENABLE -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { - // Anything you can do in a macro. - SEND_STRING("QMK is awesome."); - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING(SS_LCTL("a") SS_LCTL("c")); - } - SEQ_TWO_KEYS(KC_S, KC_S) { - SEND_STRING(SS_LCTL("v")); - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https://start.duckduckgo.com\n"); - } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Anything you can do in a macro. + SEND_STRING("QMK is awesome."); + } + if (leader_sequence_two_keys(KC_D, KC_D)) { + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } + if (leader_sequence_two_keys(KC_S, KC_S)) { + SEND_STRING(SS_LCTL("v")); + } + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + SEND_STRING("https://start.duckduckgo.com\n"); } } -#endif diff --git a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c index d150416bed..11f8103297 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c @@ -255,30 +255,19 @@ bool rgb_matrix_indicators_user(void) { return false; } -#ifdef LEADER_ENABLE -LEADER_EXTERNS(); - -//SEND_STRING seems to be local dependent. -//For swiss-german layout I have to send "ctrl+." to get ":" -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { - // Anything you can do in a macro. - SEND_STRING("QMK is awesome."); - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING(SS_LCTL("a") SS_LCTL("c")); - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https"); - register_code(KC_LSFT); - SEND_STRING(".77"); - unregister_code(KC_LSFT); - SEND_STRING("start.duckduckgo.com\n"); - } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Anything you can do in a macro. + SEND_STRING("QMK is awesome."); + } + if (leader_sequence_two_keys(KC_D, KC_D)) { + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + SEND_STRING("https"); + register_code(KC_LSFT); + SEND_STRING(".77"); + unregister_code(KC_LSFT); + SEND_STRING("start.duckduckgo.com\n"); } } -#endif diff --git a/keyboards/massdrop/alt/keymaps/jdelkins/keymap.c b/keyboards/massdrop/alt/keymaps/jdelkins/keymap.c index 4c9a8860f4..64a9f6f598 100644 --- a/keyboards/massdrop/alt/keymaps/jdelkins/keymap.c +++ b/keyboards/massdrop/alt/keymaps/jdelkins/keymap.c @@ -256,6 +256,54 @@ static void set_rgb_layer(int layer) { } } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_K)) { + layer_invert(_KP); + } + if (leader_sequence_one_key(KC_G)) { + layer_invert(_GAME); + } + if (leader_sequence_one_key(KC_KP_5)) { + layer_invert(_KP); + } + if (leader_sequence_two_keys(KC_SCLN, KC_1)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_2)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_3)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_4)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_5)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_6)) { + send_secret_string(5); + } + if (leader_sequence_two_keys(KC_SCLN, KC_M)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_COMM)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_DOT)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_J)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_K)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_L)) { + send_secret_string(5); + } +} + // Runs just one time when the keyboard initializes. void matrix_init_keymap(void) { // force numlock on upon startup @@ -264,8 +312,6 @@ void matrix_init_keymap(void) { } }; -LEADER_EXTERNS(); - // Runs constantly in the background, in a loop. void matrix_scan_keymap(void) { if (rgb_matrix_get_flags() != LED_FLAG_NONE && timer_elapsed(rgb_timer) > 1000) { @@ -282,56 +328,6 @@ void matrix_scan_keymap(void) { else rgb_matrix_set_color(15, 0, 0, 0); } - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_K) { - layer_invert(_KP); - } - SEQ_ONE_KEY(KC_G) { - layer_invert(_GAME); - } - SEQ_ONE_KEY(KC_KP_5) { - layer_invert(_KP); - } - SEQ_TWO_KEYS(KC_SCLN, KC_1) { - send_secret_string(0); - } - SEQ_TWO_KEYS(KC_SCLN, KC_2) { - send_secret_string(1); - } - SEQ_TWO_KEYS(KC_SCLN, KC_3) { - send_secret_string(2); - } - SEQ_TWO_KEYS(KC_SCLN, KC_4) { - send_secret_string(3); - } - SEQ_TWO_KEYS(KC_SCLN, KC_5) { - send_secret_string(4); - } - SEQ_TWO_KEYS(KC_SCLN, KC_6) { - send_secret_string(5); - } - SEQ_TWO_KEYS(KC_SCLN, KC_M) { - send_secret_string(0); - } - SEQ_TWO_KEYS(KC_SCLN, KC_COMM) { - send_secret_string(1); - } - SEQ_TWO_KEYS(KC_SCLN, KC_DOT) { - send_secret_string(2); - } - SEQ_TWO_KEYS(KC_SCLN, KC_J) { - send_secret_string(3); - } - SEQ_TWO_KEYS(KC_SCLN, KC_K) { - send_secret_string(4); - } - SEQ_TWO_KEYS(KC_SCLN, KC_L) { - send_secret_string(5); - } - } }; layer_state_t layer_state_set_keymap(layer_state_t state) { diff --git a/keyboards/maxr1998/phoebe/keymaps/default/keymap.c b/keyboards/maxr1998/phoebe/keymaps/default/keymap.c index 74a70f6174..b83d51f32a 100644 --- a/keyboards/maxr1998/phoebe/keymaps/default/keymap.c +++ b/keyboards/maxr1998/phoebe/keymaps/default/keymap.c @@ -130,18 +130,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_TWO_KEYS(KC_G, KC_P) { - SEND_STRING("git push"); - } - SEQ_THREE_KEYS(KC_G, KC_F, KC_P) { - SEND_STRING("git push --force-with-lease"); - } +void leader_end_user(void) { + if (leader_sequence_two_keys(KC_G, KC_P)) { + SEND_STRING("git push"); + } + if (leader_sequence_three_keys(KC_G, KC_F, KC_P)) { + SEND_STRING("git push --force-with-lease"); } } diff --git a/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c b/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c index 2338bb7d04..85725c8c5c 100644 --- a/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c +++ b/keyboards/mechkeys/mechmini/v2/keymaps/wsturgiss/keymap.c @@ -50,39 +50,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; //Leader maps - - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { - // Anything you can do in a macro. - SEND_STRING("QMK is awesome."); +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Anything you can do in a macro. + SEND_STRING("QMK is awesome."); } //tableflip (LEADER - TF) - SEQ_TWO_KEYS(KC_T, KC_F) { + if (leader_sequence_two_keys(KC_T, KC_F)) { set_unicode_input_mode(UNICODE_MODE_MACOS); send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); } //screencap (LEADER - SC) - SEQ_TWO_KEYS(KC_S, KC_C) { - SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))); + if (leader_sequence_two_keys(KC_S, KC_C)) { + SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))); } //screencap (LEADER - TM) - SEQ_TWO_KEYS(KC_T, KC_M) { + if (leader_sequence_two_keys(KC_T, KC_M)) { set_unicode_input_mode(UNICODE_MODE_MACOS); register_unicode(0x2122); // ™ } /* - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https://start.duckduckgo.com"SS_TAP(X_ENTER)); + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + SEND_STRING("https://start.duckduckgo.com"SS_TAP(X_ENTER)); } */ - } } //change colors and rgb modes on layer change diff --git a/keyboards/planck/keymaps/copface/keymap.c b/keyboards/planck/keymaps/copface/keymap.c index 8435ef405d..376ceeb288 100644 --- a/keyboards/planck/keymaps/copface/keymap.c +++ b/keyboards/planck/keymaps/copface/keymap.c @@ -157,47 +157,41 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -LEADER_EXTERNS(); -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Screenshot - SEQ_ONE_KEY(KC_S) { - tap_code16(G(C(S(KC_4)))); - } - // Record Screen - SEQ_TWO_KEYS(KC_S, KC_S) { - tap_code16(S(G(KC_5))); - } - // 1Pass browser - SEQ_ONE_KEY(KC_A) { - tap_code16(G(A(KC_BSLS))); - } - // 1Pass mini - SEQ_TWO_KEYS(KC_A, KC_A) { - tap_code16(G(KC_BSLS)); - } - // Comment out - SEQ_ONE_KEY(KC_F) { - tap_code16(G(KC_SLSH)); - } - // Spotlight - SEQ_ONE_KEY(KC_SPC) { - tap_code16(G(KC_SPC)); - } - // Auto format - SEQ_ONE_KEY(KC_ENT) { - tap_code16(S(G(A(KC_F)))); - } - // Focus file tree - SEQ_ONE_KEY(KC_TAB) { - tap_code16(G(KC_1)); - } - // Caps-lock - SEQ_TWO_KEYS(KC_TAB, KC_TAB) { - tap_code16(KC_CAPS); - } +void leader_end_user(void) { + // Screenshot + if (leader_sequence_one_key(KC_S)) { + tap_code16(G(C(S(KC_4)))); + } + // Record Screen + if (leader_sequence_two_keys(KC_S, KC_S)) { + tap_code16(S(G(KC_5))); + } + // 1Pass browser + if (leader_sequence_one_key(KC_A)) { + tap_code16(G(A(KC_BSLS))); + } + // 1Pass mini + if (leader_sequence_two_keys(KC_A, KC_A)) { + tap_code16(G(KC_BSLS)); + } + // Comment out + if (leader_sequence_one_key(KC_F)) { + tap_code16(G(KC_SLSH)); + } + // Spotlight + if (leader_sequence_one_key(KC_SPC)) { + tap_code16(G(KC_SPC)); + } + // Auto format + if (leader_sequence_one_key(KC_ENT)) { + tap_code16(S(G(A(KC_F)))); + } + // Focus file tree + if (leader_sequence_one_key(KC_TAB)) { + tap_code16(G(KC_1)); + } + // Caps-lock + if (leader_sequence_two_keys(KC_TAB, KC_TAB)) { + tap_code16(KC_CAPS); } } diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index e0ade650fe..d5c7425439 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -372,39 +372,32 @@ void music_scale_user(void) #endif -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY (KC_R) { - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - } - SEQ_ONE_KEY (KC_V) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - SEQ_ONE_KEY(KC_F) { - SEND_STRING("if yes\n\tpeanut butter\nelse\n\trice snacks"); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_H); - unregister_code(KC_H); - } - SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); - } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_R)) { + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + } + if (leader_sequence_one_key(KC_V)) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + if (leader_sequence_one_key(KC_F)) { + SEND_STRING("if yes\n\tpeanut butter\nelse\n\trice snacks"); + } + if (leader_sequence_two_keys(KC_A, KC_S)) { + register_code(KC_H); + unregister_code(KC_H); + } + if (leader_sequence_three_keys(KC_A, KC_S, KC_D)) { + register_code(KC_LGUI); + register_code(KC_S); + unregister_code(KC_S); + unregister_code(KC_LGUI); } } diff --git a/keyboards/planck/keymaps/jdelkins/keymap.c b/keyboards/planck/keymaps/jdelkins/keymap.c index 9d306abc78..ecb49da406 100644 --- a/keyboards/planck/keymaps/jdelkins/keymap.c +++ b/keyboards/planck/keymaps/jdelkins/keymap.c @@ -408,7 +408,64 @@ void keyboard_post_init_keymap(void) { bspc_timer = 0; } -LEADER_EXTERNS(); +void leader_end_user(void) { + if (leader_sequence_one_key(KC_K)) { + layer_invert(_KP); + } + if (leader_sequence_one_key(KC_G)) { + layer_invert(_GAME); + } + if (leader_sequence_one_key(KC_KP_5)) { + layer_invert(_KP); + } + if (leader_sequence_one_key(KC_5)) { + layer_invert(_KP); + } + if (leader_sequence_two_keys(KC_SCLN, KC_1)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_2)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_3)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_4)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_5)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_6)) { + send_secret_string(5); + } + if (leader_sequence_two_keys(KC_SCLN, KC_M)) { + send_secret_string(0); + } + if (leader_sequence_two_keys(KC_SCLN, KC_COMM)) { + send_secret_string(1); + } + if (leader_sequence_two_keys(KC_SCLN, KC_DOT)) { + send_secret_string(2); + } + if (leader_sequence_two_keys(KC_SCLN, KC_J)) { + send_secret_string(3); + } + if (leader_sequence_two_keys(KC_SCLN, KC_K)) { + send_secret_string(4); + } + if (leader_sequence_two_keys(KC_SCLN, KC_L)) { + send_secret_string(5); + } + if (leader_sequence_one_key(KC_C)) { + tap_code16(C(KC_C)); + } + // neovim: terminal escape + if (leader_sequence_one_key(KC_QUOT)) { + tap_code16(C(KC_BSLS)); + tap_code16(C(KC_N)); + } +} void matrix_scan_keymap(void) { #ifdef AUDIO_ENABLE @@ -436,67 +493,6 @@ void matrix_scan_keymap(void) { bspc_timer = 0; register_code(KC_BSPC); } - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_K) { - layer_invert(_KP); - } - SEQ_ONE_KEY(KC_G) { - layer_invert(_GAME); - } - SEQ_ONE_KEY(KC_KP_5) { - layer_invert(_KP); - } - SEQ_ONE_KEY(KC_5) { - layer_invert(_KP); - } - SEQ_TWO_KEYS(KC_SCLN, KC_1) { - send_secret_string(0); - } - SEQ_TWO_KEYS(KC_SCLN, KC_2) { - send_secret_string(1); - } - SEQ_TWO_KEYS(KC_SCLN, KC_3) { - send_secret_string(2); - } - SEQ_TWO_KEYS(KC_SCLN, KC_4) { - send_secret_string(3); - } - SEQ_TWO_KEYS(KC_SCLN, KC_5) { - send_secret_string(4); - } - SEQ_TWO_KEYS(KC_SCLN, KC_6) { - send_secret_string(5); - } - SEQ_TWO_KEYS(KC_SCLN, KC_M) { - send_secret_string(0); - } - SEQ_TWO_KEYS(KC_SCLN, KC_COMM) { - send_secret_string(1); - } - SEQ_TWO_KEYS(KC_SCLN, KC_DOT) { - send_secret_string(2); - } - SEQ_TWO_KEYS(KC_SCLN, KC_J) { - send_secret_string(3); - } - SEQ_TWO_KEYS(KC_SCLN, KC_K) { - send_secret_string(4); - } - SEQ_TWO_KEYS(KC_SCLN, KC_L) { - send_secret_string(5); - } - SEQ_ONE_KEY(KC_C) { - tap_code16(C(KC_C)); - } - // neovim: terminal escape - SEQ_ONE_KEY(KC_QUOT) { - tap_code16(C(KC_BSLS)); - tap_code16(C(KC_N)); - } - } } bool music_mask_user(uint16_t keycode) { diff --git a/keyboards/planck/keymaps/jweickm/keymap.c b/keyboards/planck/keymaps/jweickm/keymap.c index eb3391c171..b206b8511e 100644 --- a/keyboards/planck/keymaps/jweickm/keymap.c +++ b/keyboards/planck/keymaps/jweickm/keymap.c @@ -984,31 +984,26 @@ bool dip_switch_update_user(uint8_t index, bool active) { return true; } - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { // Anything you can do in a macro. SEND_STRING("QMK is awesome."); } - SEQ_TWO_KEYS(KC_D, KC_D) { + if (leader_sequence_two_keys(KC_D, KC_D)) { SEND_STRING(SS_LCTL("a") SS_LCTL("c")); } - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { SEND_STRING("https://start.duckduckgo.com\n"); } - SEQ_TWO_KEYS(KC_A, KC_S) { + 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) { #ifdef AUDIO_ENABLE if (muse_mode) { if (muse_counter == 0) { diff --git a/keyboards/planck/keymaps/rootiest/keymap.c b/keyboards/planck/keymaps/rootiest/keymap.c index 5aec280af3..ce3b69ed1f 100644 --- a/keyboards/planck/keymaps/rootiest/keymap.c +++ b/keyboards/planck/keymaps/rootiest/keymap.c @@ -240,7 +240,6 @@ uint16_t muse_tempo = 50; // Used by Leader key chords bool did_leader_succeed; -LEADER_EXTERNS(); // Tap-Dance stuffs, initializing functions that are coded further below td_state_t cur_dance(tap_dance_state_t* state); @@ -1404,6 +1403,81 @@ void leader_start_user(void) { } // Called when either the leader sequence is completed, or the leader timeout is hit void leader_end_user(void) { + did_leader_succeed = false; + + if (leader_sequence_one_key(KC_E)) { + SEND_STRING(SS_LCTL(SS_LSFT("t"))); + did_leader_succeed = true; + } + if (leader_sequence_one_key(KC_C)) { + SEND_STRING(SS_LGUI("r") SS_DELAY(250) "calc\n"); + did_leader_succeed = true; + } + else if (leader_sequence_one_key(KC_V)) { + SEND_STRING(SS_LCTL("v")); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_E, KC_D)) { + SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_A, KC_C)) { + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_C, KC_A, KC_T)) { + send_unicode_string("😸"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_B, KC_A, KC_T)) { + send_unicode_string("🦇"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_D, KC_O, KC_G)) { + send_unicode_string("🐶"); + did_leader_succeed = true; + } + else if (leader_sequence_five_keys(KC_S, KC_M, KC_I, KC_L, KC_E)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_H, KC_A, KC_P, KC_Y)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_five_keys(KC_H, KC_A, KC_P, KC_P, KC_Y)) { + send_unicode_string("🙂"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_S, KC_A, KC_D)) { + send_unicode_string("🙁"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_Y, KC_E, KC_S)) { + send_unicode_string("👍"); + did_leader_succeed = true; + } + else if (leader_sequence_two_keys(KC_N, KC_O)) { + send_unicode_string("👎"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_W, KC_O, KC_W)) { + send_unicode_string("🤯"); + did_leader_succeed = true; + } + else if (leader_sequence_three_keys(KC_P, KC_O, KC_O)) { + send_unicode_string("💩"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_P, KC_O, KC_O, KC_P)) { + send_unicode_string("💩"); + did_leader_succeed = true; + } + else if (leader_sequence_four_keys(KC_B, KC_O, KC_A, KC_T)) { + send_unicode_string("⛵"); + did_leader_succeed = true; + } + if (did_leader_succeed) { #ifdef AUDIO_ENABLE PLAY_SONG(leader_succeed); @@ -1758,84 +1832,6 @@ void matrix_scan_user(void) { is_alt_tab_active = false; } } - // Monitor and perform leader-key chords - LEADER_DICTIONARY() { - did_leader_succeed = leading = false; - - SEQ_ONE_KEY(KC_E) { - SEND_STRING(SS_LCTL(SS_LSFT("t"))); - did_leader_succeed = true; - } - SEQ_ONE_KEY(KC_C) { - SEND_STRING(SS_LGUI("r") SS_DELAY(250) "calc\n"); - did_leader_succeed = true; - } - else SEQ_ONE_KEY(KC_V) { - SEND_STRING(SS_LCTL("v")); - did_leader_succeed = true; - } - else SEQ_TWO_KEYS(KC_E, KC_D) { - SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); - did_leader_succeed = true; - } - else SEQ_TWO_KEYS(KC_A, KC_C) { - SEND_STRING(SS_LCTL("a") SS_LCTL("c")); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_C, KC_A, KC_T) { - send_unicode_string("😸"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_B, KC_A, KC_T) { - send_unicode_string("🦇"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_D, KC_O, KC_G) { - send_unicode_string("🐶"); - did_leader_succeed = true; - } - else SEQ_FIVE_KEYS(KC_S, KC_M, KC_I, KC_L, KC_E) { - send_unicode_string("🙂"); - did_leader_succeed = true; - } - else SEQ_FOUR_KEYS(KC_H, KC_A, KC_P, KC_Y) { - send_unicode_string("🙂"); - did_leader_succeed = true; - } - else SEQ_FIVE_KEYS(KC_H, KC_A, KC_P, KC_P, KC_Y) { - send_unicode_string("🙂"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_S, KC_A, KC_D) { - send_unicode_string("🙁"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_Y, KC_E, KC_S) { - send_unicode_string("👍"); - did_leader_succeed = true; - } - else SEQ_TWO_KEYS(KC_N, KC_O) { - send_unicode_string("👎"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_W, KC_O, KC_W) { - send_unicode_string("🤯"); - did_leader_succeed = true; - } - else SEQ_THREE_KEYS(KC_P, KC_O, KC_O) { - send_unicode_string("💩"); - did_leader_succeed = true; - } - else SEQ_FOUR_KEYS(KC_P, KC_O, KC_O, KC_P) { - send_unicode_string("💩"); - did_leader_succeed = true; - } - else SEQ_FOUR_KEYS(KC_B, KC_O, KC_A, KC_T) { - send_unicode_string("⛵"); - did_leader_succeed = true; - } - leader_end(); - } // Run the wake-up RGB animation if performing wake-up if (do_wake_animation) { rgb_wakeup_sequence(); diff --git a/keyboards/planck/keymaps/yhaliaw/keymap.c b/keyboards/planck/keymaps/yhaliaw/keymap.c index 62d856e9f2..8931101fef 100644 --- a/keyboards/planck/keymaps/yhaliaw/keymap.c +++ b/keyboards/planck/keymaps/yhaliaw/keymap.c @@ -158,36 +158,24 @@ void keyboard_post_init_user(void) { } bool leader_found; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_found = false; - SEQ_ONE_KEY(L_RESET) { - leader_found = true; - reset_keyboard(); - } - else - SEQ_ONE_KEY(KC_DEL) { - leader_found = true; - layer_clear(); - } - else - SEQ_ONE_KEY(LOWER) { - leader_found = true; - layer_on(_LOWER); - } - else - SEQ_ONE_KEY(RAISE) { - leader_found = true; - layer_on(_RAISE); - } - leader_end(); - } -} void leader_end_user(void) { + leader_found = false; + + if (leader_sequence_one_key(L_RESET)) { + leader_found = true; + reset_keyboard(); + } else if (leader_sequence_one_key(KC_DEL)) { + leader_found = true; + layer_clear(); + } else if (leader_sequence_one_key(LOWER)) { + leader_found = true; + layer_on(_LOWER); + } else if (leader_sequence_one_key(RAISE)) { + leader_found = true; + layer_on(_RAISE); + } + // Plays sound on if leader sequence found. if (leader_found) { #ifdef AUDIO_ENABLE diff --git a/keyboards/preonic/keymaps/brauner/keymap.c b/keyboards/preonic/keymaps/brauner/keymap.c index 123a4fc215..fa1c7611cf 100644 --- a/keyboards/preonic/keymaps/brauner/keymap.c +++ b/keyboards/preonic/keymaps/brauner/keymap.c @@ -363,44 +363,35 @@ bool dip_switch_update_user(uint8_t index, bool active) { return true; } -LEADER_EXTERNS(); - static inline void register_ctrl_sequence(uint16_t keycode) { tap_code16(RCTL(keycode)); } -static inline void leader_bindings(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_THREE_KEYS(KC_A, KC_C, KC_K) { - SEND_STRING("Acked-by: Christian Brauner <brauner@kernel.org>"); - } +void leader_end_user(void) { + if (leader_sequence_three_keys(KC_A, KC_C, KC_K)) { + SEND_STRING("Acked-by: Christian Brauner <brauner@kernel.org>"); + } - SEQ_THREE_KEYS(KC_R, KC_V, KC_B) { - SEND_STRING("Reviewed-by: Christian Brauner <brauner@kernel.org>"); - } + if (leader_sequence_three_keys(KC_R, KC_V, KC_B)) { + SEND_STRING("Reviewed-by: Christian Brauner <brauner@kernel.org>"); + } - SEQ_THREE_KEYS(KC_S, KC_O, KC_B) { - SEND_STRING("Signed-off-by: Christian Brauner <brauner@kernel.org>"); - } + if (leader_sequence_three_keys(KC_S, KC_O, KC_B)) { + SEND_STRING("Signed-off-by: Christian Brauner <brauner@kernel.org>"); + } - /* Support vim-style copy. */ - SEQ_ONE_KEY(KC_Y) { - tap_code16(C(S(KC_C))); - } + /* Support vim-style copy. */ + if (leader_sequence_one_key(KC_Y)) { + tap_code16(C(S(KC_C))); + } - /* Support vim-style paste. */ - SEQ_ONE_KEY(KC_P) { - tap_code16(C(S(KC_V))); - } + /* Support vim-style paste. */ + if (leader_sequence_one_key(KC_P)) { + tap_code16(C(S(KC_V))); } } void matrix_scan_user(void) { - leader_bindings(); - #ifdef AUDIO_ENABLE if (muse_mode) { if (muse_counter == 0) { diff --git a/keyboards/preonic/keymaps/pcurt854/keymap.c b/keyboards/preonic/keymaps/pcurt854/keymap.c index 15e31df0a6..af88b10f3b 100644 --- a/keyboards/preonic/keymaps/pcurt854/keymap.c +++ b/keyboards/preonic/keymaps/pcurt854/keymap.c @@ -362,120 +362,113 @@ float leader_succeed_song[][2] = SONG(STARTUP_SOUND); //float leader_fail_song[][2] = SONG(GOODBYE_SOUND); float leader_fail_song[][2] = SONG(NO_SOUND); #endif -LEADER_EXTERNS(); -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - did_leader_succeed = leading = false; - - // tap dance - // sort by first key +void leader_start_user(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_start_song); +#endif +} - SEQ_ONE_KEY(KC_C) { - SEND_STRING(SS_TAP(X_CAPS)); - did_leader_succeed = true; - } +void leader_end_user(void) { + did_leader_succeed = false; - SEQ_ONE_KEY(KC_BSPC) { - SEND_STRING(SS_TAP(X_DEL)); - did_leader_succeed = true; - } + // tap dance + // sort by first key - SEQ_ONE_KEY(KC_D) { - SEND_STRING("{}"SS_TAP(X_LEFT)); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_D, KC_B) { - SEND_STRING("Dear Brother"); - did_leader_succeed = true; - } - SEQ_THREE_KEYS(KC_D, KC_B, KC_S) { - SEND_STRING("Dear Brothers and Sister"); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING("{"); - did_leader_succeed = true; - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_D) { - SEND_STRING("}"); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_D, KC_S) { - SEND_STRING("Dear Sister"); - did_leader_succeed = true; - } + if (leader_sequence_one_key(KC_C)) { + SEND_STRING(SS_TAP(X_CAPS)); + did_leader_succeed = true; + } - // Html Tags - SEQ_TWO_KEYS(KC_H, KC_T) { - SEND_STRING("<></>"SS_TAP(X_LEFT)); - did_leader_succeed = true; - } + if (leader_sequence_one_key(KC_BSPC)) { + SEND_STRING(SS_TAP(X_DEL)); + did_leader_succeed = true; + } - SEQ_TWO_KEYS(KC_I, KC_C) { - SEND_STRING("In Christ,"); - did_leader_succeed = true; - } + if (leader_sequence_one_key(KC_D)) { + SEND_STRING("{}"SS_TAP(X_LEFT)); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_D, KC_B)) { + SEND_STRING("Dear Brother"); + did_leader_succeed = true; + } + if (leader_sequence_three_keys(KC_D, KC_B, KC_S)) { + SEND_STRING("Dear Brothers and Sister"); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_D, KC_D)) { + SEND_STRING("{"); + did_leader_succeed = true; + } + if (leader_sequence_three_keys(KC_D, KC_D, KC_D)) { + SEND_STRING("}"); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_D, KC_S)) { + SEND_STRING("Dear Sister"); + did_leader_succeed = true; + } - SEQ_ONE_KEY(KC_J) { - SEND_STRING("<>"SS_TAP(X_LEFT)); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_J, KC_J) { - SEND_STRING("<"); - did_leader_succeed = true; - } - SEQ_THREE_KEYS(KC_J, KC_J, KC_J) { - SEND_STRING(">"); - did_leader_succeed = true; - } + // Html Tags + if (leader_sequence_two_keys(KC_H, KC_T)) { + SEND_STRING("<></>"SS_TAP(X_LEFT)); + did_leader_succeed = true; + } - SEQ_TWO_KEYS(KC_T, KC_S) { - SEND_STRING("Thanks!"); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_T, KC_Y) { - SEND_STRING("Thank you!"); - did_leader_succeed = true; - } + if (leader_sequence_two_keys(KC_I, KC_C)) { + SEND_STRING("In Christ,"); + did_leader_succeed = true; + } - SEQ_ONE_KEY(KC_X) { - SEND_STRING("()"SS_TAP(X_LEFT)); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_X, KC_X) { - SEND_STRING("("); - did_leader_succeed = true; - } - SEQ_THREE_KEYS(KC_X, KC_X, KC_X) { - SEND_STRING(")"); - did_leader_succeed = true; - } + if (leader_sequence_one_key(KC_J)) { + SEND_STRING("<>"SS_TAP(X_LEFT)); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_J, KC_J)) { + SEND_STRING("<"); + did_leader_succeed = true; + } + if (leader_sequence_three_keys(KC_J, KC_J, KC_J)) { + SEND_STRING(">"); + did_leader_succeed = true; + } - SEQ_ONE_KEY(KC_Z) { - SEND_STRING("[]"SS_TAP(X_LEFT)); - did_leader_succeed = true; - } - SEQ_TWO_KEYS(KC_Z, KC_Z) { - SEND_STRING("["); - did_leader_succeed = true; - } - SEQ_THREE_KEYS(KC_Z, KC_Z, KC_Z) { - SEND_STRING("]"); - did_leader_succeed = true; - } + if (leader_sequence_two_keys(KC_T, KC_S)) { + SEND_STRING("Thanks!"); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_T, KC_Y)) { + SEND_STRING("Thank you!"); + did_leader_succeed = true; + } - leader_end(); + if (leader_sequence_one_key(KC_X)) { + SEND_STRING("()"SS_TAP(X_LEFT)); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_X, KC_X)) { + SEND_STRING("("); + did_leader_succeed = true; + } + if (leader_sequence_three_keys(KC_X, KC_X, KC_X)) { + SEND_STRING(")"); + did_leader_succeed = true; } -} -void leader_start_user(void) { -#ifdef AUDIO_ENABLE - PLAY_SONG(leader_start_song); -#endif -} + if (leader_sequence_one_key(KC_Z)) { + SEND_STRING("[]"SS_TAP(X_LEFT)); + did_leader_succeed = true; + } + if (leader_sequence_two_keys(KC_Z, KC_Z)) { + SEND_STRING("["); + did_leader_succeed = true; + } + if (leader_sequence_three_keys(KC_Z, KC_Z, KC_Z)) { + SEND_STRING("]"); + did_leader_succeed = true; + } -void leader_end_user(void) { if (did_leader_succeed) { #ifdef AUDIO_ENABLE PLAY_SONG(leader_succeed_song); diff --git a/keyboards/preonic/keymaps/yhaliaw/keymap.c b/keyboards/preonic/keymaps/yhaliaw/keymap.c index b64aa7d745..7771199e9c 100644 --- a/keyboards/preonic/keymaps/yhaliaw/keymap.c +++ b/keyboards/preonic/keymaps/yhaliaw/keymap.c @@ -168,36 +168,24 @@ void keyboard_post_init_user(void) { } bool leader_found; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_found = false; - SEQ_ONE_KEY(L_RESET) { - leader_found = true; - reset_keyboard(); - } - else - SEQ_ONE_KEY(KC_DEL) { - leader_found = true; - layer_clear(); - } - else - SEQ_ONE_KEY(LOWER) { - leader_found = true; - layer_on(_LOWER); - } - else - SEQ_ONE_KEY(RAISE) { - leader_found = true; - layer_on(_RAISE); - } - leader_end(); - } -} void leader_end_user(void) { + leader_found = false; + + if (leader_sequence_one_key(L_RESET)) { + leader_found = true; + reset_keyboard(); + } else if (leader_sequence_one_key(KC_DEL)) { + leader_found = true; + layer_clear(); + } else if (leader_sequence_one_key(LOWER)) { + leader_found = true; + layer_on(_LOWER); + } else if (leader_sequence_one_key(RAISE)) { + leader_found = true; + layer_on(_RAISE); + } + // Plays sound on if leader sequence found. if (leader_found) { #ifdef AUDIO_ENABLE diff --git a/keyboards/signum/3_0/keymaps/sgurenkov/keymap.c b/keyboards/signum/3_0/keymaps/sgurenkov/keymap.c index cfd848fcfd..9353d28472 100644 --- a/keyboards/signum/3_0/keymaps/sgurenkov/keymap.c +++ b/keyboards/signum/3_0/keymaps/sgurenkov/keymap.c @@ -92,37 +92,47 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Cancel task CTRL+C - SEQ_ONE_KEY(KC_C) { tap_code16(C(KC_C)); } - // copy - SEQ_ONE_KEY(KC_Y) { tap_code16(G(KC_C)); } - // cut - SEQ_ONE_KEY(KC_X) { tap_code16(G(KC_X)); } - // paste - SEQ_ONE_KEY(KC_P) { tap_code16(G(KC_V)); } - // undo - SEQ_ONE_KEY(KC_U) { tap_code16(G(KC_Z)); } - // redo - SEQ_ONE_KEY(KC_R) { tap_code16(S(G(KC_Z))); } - // delete line - SEQ_TWO_KEYS(KC_D, KC_D) { - register_code(KC_LGUI); +void leader_end_user(void) { + // Cancel task CTRL+C + if (leader_sequence_one_key(KC_C)) { + tap_code16(C(KC_C)); + } + // copy + if (leader_sequence_one_key(KC_Y)) { + tap_code16(G(KC_C)); + } + // cut + if (leader_sequence_one_key(KC_X)) { + tap_code16(G(KC_X)); + } + // paste + if (leader_sequence_one_key(KC_P)) { + tap_code16(G(KC_V)); + } + // undo + if (leader_sequence_one_key(KC_U)) { + tap_code16(G(KC_Z)); + } + // redo + if (leader_sequence_one_key(KC_R)) { + tap_code16(S(G(KC_Z))); + } + // delete line + if (leader_sequence_two_keys(KC_D, KC_D)) { + register_code(KC_LGUI); - tap_code(KC_RIGHT); + tap_code(KC_RIGHT); - tap_code(KC_BACKSPACE); + tap_code(KC_BACKSPACE); - unregister_code(KC_LGUI); - } - // go to the beginning of the string - SEQ_ONE_KEY(KC_H) { tap_code16(G(KC_LEFT)); } - // go to the end of the string - SEQ_ONE_KEY(KC_L) { tap_code16(G(KC_RIGHT)); } + unregister_code(KC_LGUI); + } + // go to the beginning of the string + if (leader_sequence_one_key(KC_H)) { + tap_code16(G(KC_LEFT)); } + // go to the end of the string + if (leader_sequence_one_key(KC_L)) { + tap_code16(G(KC_RIGHT)); + } +} diff --git a/keyboards/splitkb/kyria/keymaps/asapjockey/keymap.c b/keyboards/splitkb/kyria/keymaps/asapjockey/keymap.c index c98219a755..cb8eb1e1e7 100644 --- a/keyboards/splitkb/kyria/keymaps/asapjockey/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/asapjockey/keymap.c @@ -171,16 +171,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { // Shift + Ctrl + F - tap_code16(S(C(KC_F))); - } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { // Shift + Ctrl + F + tap_code16(S(C(KC_F))); } } diff --git a/keyboards/splitkb/kyria/keymaps/cjuniet/keymap.c b/keyboards/splitkb/kyria/keymaps/cjuniet/keymap.c index a375c5cc4d..4a4bf91177 100644 --- a/keyboards/splitkb/kyria/keymaps/cjuniet/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/cjuniet/keymap.c @@ -31,8 +31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; -LEADER_EXTERNS(); - void keyboard_post_init_user(void) { led_t led_state = host_keyboard_led_state(); if (!led_state.num_lock) { @@ -44,25 +42,20 @@ layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _SYMBOLS, _NUMBERS, _SPECIALS); } -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Lock screen (macOS) - SEQ_ONE_KEY(KC_ESC) { - tap_code16(LCTL(LGUI(KC_Q))); - } +void leader_end_user(void) { + // Lock screen (macOS) + if (leader_sequence_one_key(KC_ESC)) { + tap_code16(LCTL(LGUI(KC_Q))); + } - // Escape-Shift-Z-Z (VIM) - SEQ_ONE_KEY(KC_Z) { - SEND_STRING(SS_TAP(X_ESC) SS_LSFT("zz")); - } + // Escape-Shift-Z-Z (VIM) + if (leader_sequence_one_key(KC_Z)) { + SEND_STRING(SS_TAP(X_ESC) SS_LSFT("zz")); + } - // Dead grave accent (macOS) - SEQ_ONE_KEY(KC_E) { - tap_code16(LALT(KC_GRAVE)); - } + // Dead grave accent (macOS) + if (leader_sequence_one_key(KC_E)) { + tap_code16(LALT(KC_GRAVE)); } } diff --git a/keyboards/splitkb/kyria/keymaps/corodiak/keymap.c b/keyboards/splitkb/kyria/keymaps/corodiak/keymap.c index 2a28d49752..c0ed9f133c 100644 --- a/keyboards/splitkb/kyria/keymaps/corodiak/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/corodiak/keymap.c @@ -274,48 +274,41 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); +void leader_end_user(void) { + // Set current OS indicator to macOs + if (leader_sequence_one_key(KC_M)) { + user_config.osIsWindows = false; + eeconfig_update_user(user_config.raw); + } - // Set current OS indicator to macOs - SEQ_ONE_KEY(KC_M) { - user_config.osIsWindows = false; - eeconfig_update_user(user_config.raw); - } + // Set current OS indicator to Windows + if (leader_sequence_one_key(KC_W)) { + user_config.osIsWindows = true; + eeconfig_update_user(user_config.raw); + } - // Set current OS indicator to Windows - SEQ_ONE_KEY(KC_W) { - user_config.osIsWindows = true; - eeconfig_update_user(user_config.raw); - } - - // Screenshot - SEQ_ONE_KEY(KC_S) { - if (user_config.osIsWindows == 1) { - tap_code16(S(G(KC_S))); - } else if (user_config.osIsWindows == 0) { - tap_code16(S(G(KC_4))); - } + // Screenshot + if (leader_sequence_one_key(KC_S)) { + if (user_config.osIsWindows == 1) { + tap_code16(S(G(KC_S))); + } else if (user_config.osIsWindows == 0) { + tap_code16(S(G(KC_4))); } + } - // Video - SEQ_ONE_KEY(KC_V) { - if (user_config.osIsWindows == 0) { - tap_code16(S(G(KC_5))); - } + // Video + if (leader_sequence_one_key(KC_V)) { + if (user_config.osIsWindows == 0) { + tap_code16(S(G(KC_5))); } + } - // Sleep - SEQ_ONE_KEY(KC_P) { - if (user_config.osIsWindows == 1) { - SEND_STRING(SS_LGUI("x") "u" "h"); - } else if (user_config.osIsWindows == 0) { - tap_code16(A(G(KC_PWR))); - } + // Sleep + if (leader_sequence_one_key(KC_P)) { + if (user_config.osIsWindows == 1) { + SEND_STRING(SS_LGUI("x") "u" "h"); + } else if (user_config.osIsWindows == 0) { + tap_code16(A(G(KC_PWR))); } } } diff --git a/keyboards/splitkb/kyria/keymaps/mattir/keymap.c b/keyboards/splitkb/kyria/keymaps/mattir/keymap.c index 5f97c40765..5bc0b8215e 100644 --- a/keyboards/splitkb/kyria/keymaps/mattir/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/mattir/keymap.c @@ -56,11 +56,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; +void leader_end_user(void) { + if (leader_sequence_one_key(KC_A)) { + tap_code16(SGUI(KC_L)); + } + if (leader_sequence_two_keys(KC_S, KC_S)) { + tap_code16(SGUI(KC_5)); + } +} + bool is_cmd_tab_active = false; uint16_t cmd_tab_timer = 0; -LEADER_EXTERNS(); - void matrix_scan_user(void) { if (is_cmd_tab_active) { if (timer_elapsed(cmd_tab_timer) > 1000) { @@ -68,18 +75,6 @@ void matrix_scan_user(void) { is_cmd_tab_active = false; } } - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_A) { - tap_code16(SGUI(KC_L)); - } - SEQ_TWO_KEYS(KC_S, KC_S) { - tap_code16(SGUI(KC_5)); - } - } } #ifdef OLED_ENABLE diff --git a/keyboards/splitkb/kyria/keymaps/mattir2/keymap.c b/keyboards/splitkb/kyria/keymaps/mattir2/keymap.c index 0d09bcce74..f42889da90 100644 --- a/keyboards/splitkb/kyria/keymaps/mattir2/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/mattir2/keymap.c @@ -49,18 +49,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_A) { - tap_code16(SGUI(KC_L)); - } - SEQ_TWO_KEYS(KC_S, KC_S) { - tap_code16(SGUI(KC_5)); - } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_A)) { + tap_code16(SGUI(KC_L)); + } + if (leader_sequence_two_keys(KC_S, KC_S)) { + tap_code16(SGUI(KC_5)); } } diff --git a/keyboards/splitkb/kyria/keymaps/plattfot/keymap.c b/keyboards/splitkb/kyria/keymaps/plattfot/keymap.c index 1a351803a2..2233e9b01b 100644 --- a/keyboards/splitkb/kyria/keymaps/plattfot/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/plattfot/keymap.c @@ -400,82 +400,76 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } #endif -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - // Sway navigation - SEQ_ONE_KEY(KC_Q) { // Jump to workspace 1 - SEND_STRING(SS_LGUI("1")); - } - SEQ_ONE_KEY(KC_W) { // Jump to workspace 2 - SEND_STRING(SS_LGUI("2")); - } - SEQ_ONE_KEY(KC_E) { // Jump to workspace 3 - SEND_STRING(SS_LGUI("3")); - } - SEQ_ONE_KEY(KC_R) { // Jump to workspace 4 - SEND_STRING(SS_LGUI("4")); - } - SEQ_ONE_KEY(KC_T) { // Jump to workspace 5 - SEND_STRING(SS_LGUI("5")); - } +void leader_end_user(void) { + // Sway navigation + if (leader_sequence_one_key(KC_Q)) { // Jump to workspace 1 + SEND_STRING(SS_LGUI("1")); + } + if (leader_sequence_one_key(KC_W)) { // Jump to workspace 2 + SEND_STRING(SS_LGUI("2")); + } + if (leader_sequence_one_key(KC_E)) { // Jump to workspace 3 + SEND_STRING(SS_LGUI("3")); + } + if (leader_sequence_one_key(KC_R)) { // Jump to workspace 4 + SEND_STRING(SS_LGUI("4")); + } + if (leader_sequence_one_key(KC_T)) { // Jump to workspace 5 + SEND_STRING(SS_LGUI("5")); + } - SEQ_ONE_KEY(KC_Y) { // Jump to workspace 6 - SEND_STRING(SS_LGUI("6")); - } - SEQ_ONE_KEY(KC_U) { // Jump to workspace 7 - SEND_STRING(SS_LGUI("7")); - } - SEQ_ONE_KEY(KC_I) { // Jump to workspace 8 - SEND_STRING(SS_LGUI("8")); - } - SEQ_ONE_KEY(KC_O) { // Jump to workspace 9 - SEND_STRING(SS_LGUI("9")); - } - SEQ_ONE_KEY(KC_P) { // Jump to workspace 0 - SEND_STRING(SS_LGUI("0")); - } - SEQ_ONE_KEY(KC_G) { // View scratch pad - SEND_STRING(SS_LGUI("-")); - } + if (leader_sequence_one_key(KC_Y)) { // Jump to workspace 6 + SEND_STRING(SS_LGUI("6")); + } + if (leader_sequence_one_key(KC_U)) { // Jump to workspace 7 + SEND_STRING(SS_LGUI("7")); + } + if (leader_sequence_one_key(KC_I)) { // Jump to workspace 8 + SEND_STRING(SS_LGUI("8")); + } + if (leader_sequence_one_key(KC_O)) { // Jump to workspace 9 + SEND_STRING(SS_LGUI("9")); + } + if (leader_sequence_one_key(KC_P)) { // Jump to workspace 0 + SEND_STRING(SS_LGUI("0")); + } + if (leader_sequence_one_key(KC_G)) { // View scratch pad + SEND_STRING(SS_LGUI("-")); + } - // Sway move window - SEQ_TWO_KEYS(KC_M, KC_Q) { // Move to workspace 1 - SEND_STRING(SS_LSFT(SS_LGUI("1"))); - } - SEQ_TWO_KEYS(KC_M, KC_W) { // Move to workspace 2 - SEND_STRING(SS_LSFT(SS_LGUI("2"))); - } - SEQ_TWO_KEYS(KC_M, KC_E) { // Move to workspace 3 - SEND_STRING(SS_LSFT(SS_LGUI("3"))); - } - SEQ_TWO_KEYS(KC_M, KC_R) { // Move to workspace 4 - SEND_STRING(SS_LSFT(SS_LGUI("4"))); - } - SEQ_TWO_KEYS(KC_M, KC_T) { // Move to workspace 5 - SEND_STRING(SS_LSFT(SS_LGUI("5"))); - } + // Sway move window + if (leader_sequence_two_keys(KC_M, KC_Q)) { // Move to workspace 1 + SEND_STRING(SS_LSFT(SS_LGUI("1"))); + } + if (leader_sequence_two_keys(KC_M, KC_W)) { // Move to workspace 2 + SEND_STRING(SS_LSFT(SS_LGUI("2"))); + } + if (leader_sequence_two_keys(KC_M, KC_E)) { // Move to workspace 3 + SEND_STRING(SS_LSFT(SS_LGUI("3"))); + } + if (leader_sequence_two_keys(KC_M, KC_R)) { // Move to workspace 4 + SEND_STRING(SS_LSFT(SS_LGUI("4"))); + } + if (leader_sequence_two_keys(KC_M, KC_T)) { // Move to workspace 5 + SEND_STRING(SS_LSFT(SS_LGUI("5"))); + } - SEQ_TWO_KEYS(KC_M, KC_Y) { // Move to workspace 6 - SEND_STRING(SS_LSFT(SS_LGUI("6"))); - } - SEQ_TWO_KEYS(KC_M, KC_U) { // Move to workspace 7 - SEND_STRING(SS_LSFT(SS_LGUI("7"))); - } - SEQ_TWO_KEYS(KC_M, KC_I) { // Move to workspace 8 - SEND_STRING(SS_LSFT(SS_LGUI("8"))); - } - SEQ_TWO_KEYS(KC_M, KC_O) { // Move to workspace 9 - SEND_STRING(SS_LSFT(SS_LGUI("9"))); - } - SEQ_TWO_KEYS(KC_M, KC_P) { // Move to workspace 0 - SEND_STRING(SS_LSFT(SS_LGUI("0"))); - } - SEQ_TWO_KEYS(KC_M, KC_G) { // Move to scratch pad - SEND_STRING(SS_LSFT(SS_LGUI("-"))); - } + if (leader_sequence_two_keys(KC_M, KC_Y)) { // Move to workspace 6 + SEND_STRING(SS_LSFT(SS_LGUI("6"))); + } + if (leader_sequence_two_keys(KC_M, KC_U)) { // Move to workspace 7 + SEND_STRING(SS_LSFT(SS_LGUI("7"))); + } + if (leader_sequence_two_keys(KC_M, KC_I)) { // Move to workspace 8 + SEND_STRING(SS_LSFT(SS_LGUI("8"))); + } + if (leader_sequence_two_keys(KC_M, KC_O)) { // Move to workspace 9 + SEND_STRING(SS_LSFT(SS_LGUI("9"))); + } + if (leader_sequence_two_keys(KC_M, KC_P)) { // Move to workspace 0 + SEND_STRING(SS_LSFT(SS_LGUI("0"))); + } + if (leader_sequence_two_keys(KC_M, KC_G)) { // Move to scratch pad + SEND_STRING(SS_LSFT(SS_LGUI("-"))); } } diff --git a/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c b/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c index 420d9a89af..3ed7dbee6e 100644 --- a/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/thomasbaart/keymap.c @@ -173,12 +173,54 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +void leader_end_user(void) { + if (leader_sequence_one_key(KC_C)) { // Inline Code + SEND_STRING("`` " SS_TAP(X_LEFT) SS_TAP(X_LEFT)); + } + if (leader_sequence_one_key(KC_P)) { // Invoke Password Manager + SEND_STRING(SS_LCTL(SS_LALT("\\"))); + } + if (leader_sequence_one_key(KC_S)) { // Windows screenshot + SEND_STRING(SS_LGUI("\nS")); + } + if (leader_sequence_two_keys(KC_F, KC_P)) { // Fusion Projection prefix + SEND_STRING("[Projection] "); + } + if (leader_sequence_two_keys(KC_B, KC_B)) { // Basecone invoice description + SEND_STRING("[Leveranciersnaam] [Factuurnummer]"); + } + if (leader_sequence_two_keys(KC_E, KC_S)) { // Support email splitkb + SEND_STRING("support@splitkb.com"); + } + if (leader_sequence_two_keys(KC_E, KC_T)) { // Email splitkb + SEND_STRING("thomas@splitkb.com"); + } + if (leader_sequence_two_keys(KC_E, KC_P)) { // Email personal + SEND_STRING("mail@thomasbaart.nl"); + } + if (leader_sequence_two_keys(KC_S, KC_D)) { // Splitkb documentation + SEND_STRING("https://docs.splitkb.com/"); + } + if (leader_sequence_two_keys(KC_S, KC_V)) { // Splitkb VAT number + SEND_STRING("NL210593349B01"); + } + if (leader_sequence_two_keys(KC_B, KC_C)) { // Discord bongocat + SEND_STRING(":bongocat:\n"); + } + if (leader_sequence_two_keys(KC_C, KC_B)) { // Discord code block + SEND_STRING("```c" SS_LSFT("\n\n") "``` " SS_TAP(X_UP)); + } + if (leader_sequence_two_keys(KC_Y, KC_S)) { // Greeting + SEND_STRING("Yours sincerely,\n\nThomas Baart"); + } + if (leader_sequence_three_keys(KC_M, KC_V, KC_G)) { // Greeting + SEND_STRING("Met vriendelijke groet,\n\nThomas Baart"); + } +} bool is_alt_tab_active = false; uint16_t alt_tab_timer = 0; -LEADER_EXTERNS(); - void matrix_scan_user(void) { if (is_alt_tab_active) { if (timer_elapsed(alt_tab_timer) > 1000) { @@ -186,54 +228,6 @@ void matrix_scan_user(void) { is_alt_tab_active = false; } } - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_C) { // Inline Code - SEND_STRING("`` " SS_TAP(X_LEFT) SS_TAP(X_LEFT)); - } - SEQ_ONE_KEY(KC_P) { // Invoke Password Manager - SEND_STRING(SS_LCTL(SS_LALT("\\"))); - } - SEQ_ONE_KEY(KC_S) { // Windows screenshot - SEND_STRING(SS_LGUI("\nS")); - } - SEQ_TWO_KEYS(KC_F, KC_P) { // Fusion Projection prefix - SEND_STRING("[Projection] "); - } - SEQ_TWO_KEYS(KC_B, KC_B) { // Basecone invoice description - SEND_STRING("[Leveranciersnaam] [Factuurnummer]"); - } - SEQ_TWO_KEYS(KC_E, KC_S) { // Support email splitkb - SEND_STRING("support@splitkb.com"); - } - SEQ_TWO_KEYS(KC_E, KC_T) { // Email splitkb - SEND_STRING("thomas@splitkb.com"); - } - SEQ_TWO_KEYS(KC_E, KC_P) { // Email personal - SEND_STRING("mail@thomasbaart.nl"); - } - SEQ_TWO_KEYS(KC_S, KC_D) { // Splitkb documentation - SEND_STRING("https://docs.splitkb.com/"); - } - SEQ_TWO_KEYS(KC_S, KC_V) { // Splitkb VAT number - SEND_STRING("NL210593349B01"); - } - SEQ_TWO_KEYS(KC_B, KC_C) { // Discord bongocat - SEND_STRING(":bongocat:\n"); - } - SEQ_TWO_KEYS(KC_C, KC_B) { // Discord code block - SEND_STRING("```c" SS_LSFT("\n\n") "``` " SS_TAP(X_UP)); - } - SEQ_TWO_KEYS(KC_Y, KC_S) { // Greeting - SEND_STRING("Yours sincerely,\n\nThomas Baart"); - } - SEQ_THREE_KEYS(KC_M, KC_V, KC_G) { // Greeting - SEND_STRING("Met vriendelijke groet,\n\nThomas Baart"); - } - } } #ifdef OLED_ENABLE diff --git a/keyboards/tada68/keymaps/laas/keymap.c b/keyboards/tada68/keymaps/laas/keymap.c index fcc71021a3..165112263a 100755 --- a/keyboards/tada68/keymaps/laas/keymap.c +++ b/keyboards/tada68/keymaps/laas/keymap.c @@ -7,8 +7,6 @@ #define _BL 0 #define _FL 1 -LEADER_EXTERNS(); - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,----------------------------------------------------------------. |