Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user