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