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/planck/keymaps/copface | |
parent | d10350cd2ceb2b9d80522cdec3ea908118f7fd35 (diff) |
Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/planck/keymaps/copface')
-rw-r--r-- | keyboards/planck/keymaps/copface/keymap.c | 78 |
1 files changed, 36 insertions, 42 deletions
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); } } |