summaryrefslogtreecommitdiffstats
path: root/keyboards/kprepublic
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-02-13 03:19:02 +1100
committerGitHub <noreply@github.com>2023-02-13 03:19:02 +1100
commitbbf7a20b33de2d203518687cb5cd1aa85005ea27 (patch)
treeee1a5c412a02021d085c81a26321c3424eca7022 /keyboards/kprepublic
parentd10350cd2ceb2b9d80522cdec3ea908118f7fd35 (diff)
Refactor Leader key feature (#19632)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/kprepublic')
-rw-r--r--keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c35
-rw-r--r--keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c39
2 files changed, 27 insertions, 47 deletions
diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c
index a2719798de..03d1ddabed 100644
--- a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c
+++ b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c
@@ -446,27 +446,18 @@ bool rgb_matrix_indicators_user(void) {
return false;
}
-#ifdef LEADER_ENABLE
-LEADER_EXTERNS();
-
-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_TWO_KEYS(KC_S, KC_S) {
- SEND_STRING(SS_LCTL("v"));
- }
- SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
- SEND_STRING("https://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_two_keys(KC_S, KC_S)) {
+ SEND_STRING(SS_LCTL("v"));
+ }
+ if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) {
+ SEND_STRING("https://start.duckduckgo.com\n");
}
}
-#endif
diff --git a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c
index d150416bed..11f8103297 100644
--- a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c
+++ b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c
@@ -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