From bbf7a20b33de2d203518687cb5cd1aa85005ea27 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 13 Feb 2023 03:19:02 +1100 Subject: Refactor Leader key feature (#19632) Co-authored-by: Drashna Jaelre --- keyboards/7c8/framework/keymaps/steven/keymap.c | 55 +++++++++++-------------- 1 file changed, 24 insertions(+), 31 deletions(-) (limited to 'keyboards/7c8') 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)); + } - // , toggle desktop - SEQ_TWO_KEYS(KC_SPC, KC_SPC) { - tap_code16(G(KC_D)); - } + // , toggle desktop + if (leader_sequence_two_keys(KC_SPC, KC_SPC)) { + tap_code16(G(KC_D)); } } -- cgit v1.2.3