diff options
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); - } - } } |