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 --- docs/feature_leader_key.md | 338 ++++++++++++++------- keyboards/7c8/framework/keymaps/steven/keymap.c | 55 ++-- keyboards/dz60/keymaps/jdelkins/keymap.c | 86 +++--- keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c | 159 +++++----- .../hacker_dvorak/leader/leader_dictionary.c | 14 - .../keymaps/hacker_dvorak/leader/leader_setup.c | 1 - .../keymaps/hacker_dvorak/user/matrix_scan_user.c | 16 +- keyboards/ergodox_ez/keymaps/stamm/keymap.c | 52 ++-- .../co60/keymaps/jmdaly_hhkb_split_space/keymap.c | 148 ++++----- keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c | 22 -- .../squiggle/keymaps/rick-complicated/keymap.c | 13 +- .../keymaps/not-quite-neo/keymap.c | 51 ++-- keyboards/keebio/iris/keymaps/omgvee/keymap.c | 3 - .../keychron/q1/iso/keymaps/victorsavu3/keymap.c | 110 ++++--- .../bm65hsrgb_iso/keymaps/p4yne/keymap.c | 35 +-- .../bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c | 39 +-- keyboards/massdrop/alt/keymaps/jdelkins/keymap.c | 100 +++--- keyboards/maxr1998/phoebe/keymaps/default/keymap.c | 19 +- .../mechmini/v2/keymaps/wsturgiss/keymap.c | 29 +- keyboards/planck/keymaps/copface/keymap.c | 78 +++-- keyboards/planck/keymaps/experimental/keymap.c | 61 ++-- keyboards/planck/keymaps/jdelkins/keymap.c | 120 ++++---- keyboards/planck/keymaps/jweickm/keymap.c | 21 +- keyboards/planck/keymaps/rootiest/keymap.c | 154 +++++----- keyboards/planck/keymaps/yhaliaw/keymap.c | 44 +-- keyboards/preonic/keymaps/brauner/keymap.c | 43 ++- keyboards/preonic/keymaps/pcurt854/keymap.c | 193 ++++++------ keyboards/preonic/keymaps/yhaliaw/keymap.c | 44 +-- keyboards/signum/3_0/keymaps/sgurenkov/keymap.c | 70 +++-- .../splitkb/kyria/keymaps/asapjockey/keymap.c | 13 +- keyboards/splitkb/kyria/keymaps/cjuniet/keymap.c | 31 +- keyboards/splitkb/kyria/keymaps/corodiak/keymap.c | 65 ++-- keyboards/splitkb/kyria/keymaps/mattir/keymap.c | 23 +- keyboards/splitkb/kyria/keymaps/mattir2/keymap.c | 19 +- keyboards/splitkb/kyria/keymaps/plattfot/keymap.c | 142 +++++---- .../splitkb/kyria/keymaps/thomasbaart/keymap.c | 94 +++--- keyboards/tada68/keymaps/laas/keymap.c | 2 - quantum/keyboard.c | 7 + quantum/leader.c | 101 ++++++ quantum/leader.h | 119 ++++++++ quantum/process_keycode/process_leader.c | 77 ++--- quantum/process_keycode/process_leader.h | 24 -- quantum/quantum.h | 1 + tests/leader/config.h | 6 + tests/leader/leader_no_initial_timeout/config.h | 8 + tests/leader/leader_no_initial_timeout/test.mk | 7 + .../test_leader_no_initial_timeout.cpp | 48 +++ tests/leader/leader_per_key_timeout/config.h | 5 + tests/leader/leader_per_key_timeout/test.mk | 7 + .../test_leader_per_key_timeout.cpp | 40 +++ tests/leader/leader_sequences.c | 26 ++ tests/leader/leader_strict_key_processing/config.h | 8 + tests/leader/leader_strict_key_processing/test.mk | 7 + .../test_leader_strict_key_processing.cpp | 45 +++ tests/leader/test.mk | 7 + tests/leader/test_leader.cpp | 224 ++++++++++++++ users/alfrdmalr/alfrdmalr.c | 16 +- users/arkag/arkag.c | 257 ++++++++-------- users/curry/leader.c | 24 -- users/curry/leader.h | 3 - users/curry/leader_user.c | 31 ++ users/curry/leader_user.h | 3 + users/curry/rules.mk | 2 +- users/danielo515/danielo515.c | 171 +++++++---- users/jjerrell/jjerrell.c | 65 ++-- users/kuatsure/kuatsure.c | 141 ++++----- users/kuchosauronad0/leader.c | 116 ------- users/kuchosauronad0/leader.h | 6 - users/kuchosauronad0/leader_user.c | 113 +++++++ users/kuchosauronad0/leader_user.h | 6 + users/kuchosauronad0/readme.md | 4 +- users/kuchosauronad0/rgblight_user.c | 2 +- users/kuchosauronad0/rules.mk | 2 +- users/sigma/sigma.c | 33 +- users/uqs/uqs.c | 45 ++- users/yet-another-developer/leader.c | 46 --- users/yet-another-developer/leader.h | 6 - users/yet-another-developer/leader_user.c | 41 +++ users/yet-another-developer/leader_user.h | 6 + users/yet-another-developer/rules.mk | 2 +- 80 files changed, 2452 insertions(+), 1963 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c delete mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c create mode 100644 quantum/leader.c create mode 100644 quantum/leader.h create mode 100644 tests/leader/config.h create mode 100644 tests/leader/leader_no_initial_timeout/config.h create mode 100644 tests/leader/leader_no_initial_timeout/test.mk create mode 100644 tests/leader/leader_no_initial_timeout/test_leader_no_initial_timeout.cpp create mode 100644 tests/leader/leader_per_key_timeout/config.h create mode 100644 tests/leader/leader_per_key_timeout/test.mk create mode 100644 tests/leader/leader_per_key_timeout/test_leader_per_key_timeout.cpp create mode 100644 tests/leader/leader_sequences.c create mode 100644 tests/leader/leader_strict_key_processing/config.h create mode 100644 tests/leader/leader_strict_key_processing/test.mk create mode 100644 tests/leader/leader_strict_key_processing/test_leader_strict_key_processing.cpp create mode 100644 tests/leader/test.mk create mode 100644 tests/leader/test_leader.cpp delete mode 100644 users/curry/leader.c delete mode 100644 users/curry/leader.h create mode 100644 users/curry/leader_user.c create mode 100644 users/curry/leader_user.h delete mode 100644 users/kuchosauronad0/leader.c delete mode 100644 users/kuchosauronad0/leader.h create mode 100644 users/kuchosauronad0/leader_user.c create mode 100644 users/kuchosauronad0/leader_user.h delete mode 100644 users/yet-another-developer/leader.c delete mode 100644 users/yet-another-developer/leader.h create mode 100644 users/yet-another-developer/leader_user.c create mode 100644 users/yet-another-developer/leader_user.h diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index d3dc9a56db..72a6818dd1 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -1,165 +1,297 @@ -# The Leader Key: A New Kind of Modifier +# The Leader Key: A New Kind of Modifier :id=the-leader-key -If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen. +If you're a Vim user, you probably know what a Leader key is. In contrast to [Combos](feature_combo.md), the Leader key allows you to hit a *sequence* of up to five keys instead, which triggers some custom functionality once complete. -That's what `QK_LEAD` does. Here's an example: +## Usage :id=usage -1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `QK_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` in your `config.h`. This sets the timeout for the `QK_LEAD` key. Specifically, when you press the `QK_LEAD` key, you only have a certain amount of time to complete the Leader Key sequence. The `300` here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low. - * By default, this timeout is how long after pressing `QK_LEAD` to complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add `#define LEADER_PER_KEY_TIMING` to your `config.h`. -3. Within your `matrix_scan_user` function, add something like this: +Add the following to your `rules.mk`: -```c -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_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https://start.duckduckgo.com\n"); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); - } - } -} +```make +LEADER_ENABLE = yes ``` -As you can see, you have a few functions. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences. +Then add the `QK_LEAD` keycode to your keymap. -Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. +## Callbacks :id=callbacks -## Adding Leader Key Support +These callbacks are invoked when the leader sequence begins and ends. In the latter you can implement your custom functionality based on the contents of the sequence buffer. -To enable Leader Key, add the following line to your keymap's `rules.mk`: +```c +void leader_start_user(void) { + // Do something when the leader key is pressed +} -```make -LEADER_ENABLE = yes +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + // Leader, f => Types the below string + SEND_STRING("QMK is awesome."); + } else if (leader_sequence_two_keys(KC_D, KC_D)) { + // Leader, d, d => Ctrl+A, Ctrl+C + SEND_STRING(SS_LCTL("a") SS_LCTL("c")); + } else if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + // Leader, d, d, s => Types the below string + SEND_STRING("https://start.duckduckgo.com\n"); + } else if (leader_sequence_two_keys(KC_A, KC_S)) { + // Leader, a, s => GUI+S + tap_code16(LGUI(KC_S)); + } +} ``` -Place the following macro in your `keymap.c` or user space source file, before any functional code. It handles declaration of external variables that will be referenced by Leader Key codes that follows: +## Basic Configuration :id=basic-configuration + +### Timeout :id=timeout + +This is the amount of time you have to complete a sequence once the leader key has been pressed. The default value is 300 milliseconds, but you can change this by adding the following to your `config.h`: ```c -LEADER_EXTERNS(); +#define LEADER_TIMEOUT 350 ``` -## Per Key Timing on Leader keys +### Per-Key Timeout :id=per-key-timeout -Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). +Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200 wpm typing skills, you can enable per-key timing to ensure that each key pressed provides you with more time to finish the sequence. This is incredibly helpful with leader key emulation of tap dance (such as multiple taps of the same key like C, C, C). + +To enable this, add the following to your `config.h`: -In order to enable this, place this in your `config.h`: ```c #define LEADER_PER_KEY_TIMING ``` -After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. +After this, it's recommended that you lower your timeout below 300 ms: ```c #define LEADER_TIMEOUT 250 ``` -Now, something like this won't seem impossible to do without a 1000MS leader key timeout: +Now, something like this won't seem impossible to do without a 1000 millisecond timeout: ```c -SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { - SEND_STRING("Per key timing is great!!!"); +if (leader_sequence_three_keys(KC_C, KC_C, KC_C)) { + SEND_STRING("Per key timing is great!!!"); } ``` -## Infinite Leader key timeout +### Disabling Initial Timeout :id=disabling-initial-timeout + +Sometimes your leader key may be too far away from the rest of the keys in the sequence. Imagine that your leader key is one of your outer top right keys - you may need to reposition your hand just to reach your leader key. This can make typing the entire sequence on time hard difficult if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd`, typing `asd` fast is very easy once you have your hands in your home row, but starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. -Sometimes your leader key is not on a comfortable place as the rest of keys on your sequence. Imagine that your leader key is one of your outer top right keys, you may need to reposition your hand just to reach your leader key. -This can make typing the entire sequence on time hard even if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd` typing `asd` fast is very easy once you have your hands in your home row. However starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. -To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This means that after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably. -This infinite timeout only affects the leader key, so in our previous example of `Leader + asd` you will have an infinite amount of time between `Leader` and `a`, but once you start the sequence the timeout you have configured (global or per key) will work normally. -This way you can configure a very short `LEADER_TIMEOUT` but still have plenty of time to position your hands. +To remove the stress this situation produces to your hands, you can disable the timeout just for the leader key. Add the following to your `config.h`: -In order to enable this, place this in your `config.h`: ```c #define LEADER_NO_TIMEOUT ``` -## Strict Key Processing - -By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](mod_tap.md) and [`Layer Tap`](feature_layers.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. +Now, after you hit the leader key, you will have an infinite amount of time to start the rest of the sequence, allowing you to properly position your hands to type the rest of the sequence comfortably. This way you can configure a very short `LEADER_TIMEOUT`, but still have plenty of time to position your hands. -While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by adding `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This will then disable the filtering, and you'll need to specify the whole keycode. +### Strict Key Processing :id=strict-key-processing -## Customization +By default, only the "tap keycode" portions of [Mod-Taps](mod_tap.md) and [Layer Taps](feature_layers.md#switching-and-toggling-layers) are added to the sequence buffer. This means if you press eg. `LT(3, KC_A)` as part of a sequence, `KC_A` will be added to the buffer, rather than the entire `LT(3, KC_A)` keycode. -The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start_user()` and `leader_end_user()`. +This gives a more expected behaviour for most users, however you may want to change this. -The `leader_start_user()` function is called when you tap the `QK_LEAD` key, and the `leader_end_user()` function is called when either the leader sequence is completed, or the leader timeout is hit. - -You can add these functions to your code (`keymap.c` usually) to add feedback to the Leader sequences (such as beeping or playing music). +To enable this, add the following to your `config.h`: ```c -void leader_start_user(void) { - // sequence started -} - -void leader_end_user(void) { - // sequence ended (no success/failure detection) -} +#define LEADER_KEY_STRICT_KEY_PROCESSING ``` -### Example +## Example :id=example -This example will play the Mario "One Up" sound when you hit `QK_LEAD` to start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails. +This example will play the Mario "One Up" sound when you hit `QK_LEAD` to start the leader sequence. When the sequence ends, it will play "All Star" if it completes successfully or "Rick Roll" you if it fails (in other words, no sequence matched). ```c -bool did_leader_succeed; #ifdef AUDIO_ENABLE -float leader_start[][2] = SONG(ONE_UP_SOUND ); -float leader_succeed[][2] = SONG(ALL_STAR); -float leader_fail[][2] = SONG(RICK_ROLL); +float leader_start_song[][2] = SONG(ONE_UP_SOUND); +float leader_succeed_song[][2] = SONG(ALL_STAR); +float leader_fail_song[][2] = SONG(RICK_ROLL); #endif -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - did_leader_succeed = leading = false; - - SEQ_ONE_KEY(KC_E) { - // Anything you can do in a macro. - SEND_STRING(SS_LCTL(SS_LSFT("t"))); - did_leader_succeed = true; - } else - SEQ_TWO_KEYS(KC_E, KC_D) { - SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); - did_leader_succeed = true; - } - leader_end(); - } -} void leader_start_user(void) { #ifdef AUDIO_ENABLE - PLAY_SONG(leader_start); + PLAY_SONG(leader_start_song); #endif } void leader_end_user(void) { - if (did_leader_succeed) { -#ifdef AUDIO_ENABLE - PLAY_SONG(leader_succeed); -#endif - } else { + bool did_leader_succeed = false; + + if (leader_sequence_one_key(KC_E)) { + SEND_STRING(SS_LCTL(SS_LSFT("t"))); + did_leader_succeed = true; + } else if (leader_sequence_two_keys(KC_E, KC_D)) { + SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); + did_leader_succeed = true; + } + #ifdef AUDIO_ENABLE - PLAY_SONG(leader_fail); + if (did_leader_succeed) { + PLAY_SONG(leader_succeed_song); + } else { + PLAY_SONG(leader_fail_song); + } #endif - } } ``` + +## Keycodes :id=keycodes + +|Key |Aliases |Description | +|-----------------------|---------|-------------------------| +|`QK_LEADER` |`QK_LEAD`|Begin the leader sequence| + +## API :id=api + +### `void leader_start_user(void)` :id=api-leader-start-user + +User callback, invoked when the leader sequence begins. + +--- + +### `void leader_end_user(void)` :id=api-leader-end-user + +User callback, invoked when the leader sequence ends. + +--- + +### `void leader_start(void)` :id=api-leader-start + +Begin the leader sequence, resetting the buffer and timer. + +--- + +### `void leader_end(void)` :id=api-leader-end + +End the leader sequence. + +--- + +### `bool leader_sequence_active(void)` :id=api-leader-sequence-active + +Whether the leader sequence is active. + +--- + +### `bool leader_sequence_add(uint16_t keycode)` :id=api-leader-sequence-add + +Add the given keycode to the sequence buffer. + +If `LEADER_NO_TIMEOUT` is defined, the timer is reset if the buffer is empty. + +#### Arguments :id=api-leader-sequence-add-arguments + + - `uint16_t keycode` + The keycode to add. + +#### Return Value :id=api-leader-sequence-add-return + +`true` if the keycode was added, `false` if the buffer is full. + +--- + +### `bool leader_sequence_timed_out(void)` :id=api-leader-sequence-timed-out + +Whether the leader sequence has reached the timeout. + +If `LEADER_NO_TIMEOUT` is defined, the buffer must also contain at least one key. + +--- + +### `bool leader_reset_timer(void)` :id=api-leader-reset-timer + +Reset the leader sequence timer. + +--- + +### `bool leader_sequence_one_key(uint16_t kc)` :id=api-leader-sequence-one-key + +Check the sequence buffer for the given keycode. + +#### Arguments :id=api-leader-sequence-one-key-arguments + + - `uint16_t kc` + The keycode to check. + +#### Return Value :id=api-leader-sequence-one-key-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_two_keys(uint16_t kc1, uint16_t kc2)` :id=api-leader-sequence-two-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-two-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + +#### Return Value :id=api-leader-sequence-two-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_three_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3)` :id=api-leader-sequence-three-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-three-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + +#### Return Value :id=api-leader-sequence-three-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_four_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4)` :id=api-leader-sequence-four-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-four-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + - `uint16_t kc4` + The fourth keycode to check. + +#### Return Value :id=api-leader-sequence-four-keys-return + +`true` if the sequence buffer matches. + +--- + +### `bool leader_sequence_five_keys(uint16_t kc1, uint16_t kc2, uint16_t kc3, uint16_t kc4, uint16_t kc5)` :id=api-leader-sequence-five-keys + +Check the sequence buffer for the given keycodes. + +#### Arguments :id=api-leader-sequence-five-keys-arguments + + - `uint16_t kc1` + The first keycode to check. + - `uint16_t kc2` + The second keycode to check. + - `uint16_t kc3` + The third keycode to check. + - `uint16_t kc4` + The fourth keycode to check. + - `uint16_t kc5` + The fifth keycode to check. + +#### Return Value :id=api-leader-sequence-five-keys-return + +`true` if the sequence buffer matches. 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)); } } diff --git a/keyboards/dz60/keymaps/jdelkins/keymap.c b/keyboards/dz60/keymaps/jdelkins/keymap.c index 5555a0113f..2a989fe545 100644 --- a/keyboards/dz60/keymaps/jdelkins/keymap.c +++ b/keyboards/dz60/keymaps/jdelkins/keymap.c @@ -229,7 +229,47 @@ void keyboard_post_init_keymap(void) { bspc_timer = 0; } -LEADER_EXTERNS(); +void leader_end_user(void) { + // layer navigation + if (leader_sequence_one_key(KC_R)) { layer_invert(_RPT); } + if (leader_sequence_one_key(KC_G)) { layer_invert(_GAME); } + if (leader_sequence_one_key(KC_K)) { layer_invert(_KP); } + if (leader_sequence_one_key(KC_KP_5)) { layer_invert(_KP); } + + // tmux navigation + if (leader_sequence_one_key(KC_L)) { SEND_STRING(SS_LCTL("a") "n"); } + if (leader_sequence_one_key(KC_H)) { SEND_STRING(SS_LCTL("a") "p"); } + if (leader_sequence_one_key(KC_N)) { SEND_STRING(SS_LCTL("a") "c"); } + if (leader_sequence_one_key(KC_W)) { SEND_STRING(SS_LCTL("a") "x"); } + if (leader_sequence_one_key(KC_MINS)) { SEND_STRING(SS_LCTL("a") "-"); } + if (leader_sequence_one_key(KC_QUOT)) { SEND_STRING(SS_LCTL("a") "\""); } + if (leader_sequence_one_key(KC_1)) { SEND_STRING(SS_LCTL("a") "1"); } + if (leader_sequence_one_key(KC_2)) { SEND_STRING(SS_LCTL("a") "2"); } + if (leader_sequence_one_key(KC_3)) { SEND_STRING(SS_LCTL("a") "3"); } + if (leader_sequence_one_key(KC_4)) { SEND_STRING(SS_LCTL("a") "4"); } + if (leader_sequence_one_key(KC_5)) { SEND_STRING(SS_LCTL("a") "5"); } + if (leader_sequence_one_key(KC_6)) { SEND_STRING(SS_LCTL("a") "6"); } + if (leader_sequence_one_key(KC_7)) { SEND_STRING(SS_LCTL("a") "7"); } + if (leader_sequence_one_key(KC_8)) { SEND_STRING(SS_LCTL("a") "8"); } + if (leader_sequence_one_key(KC_9)) { SEND_STRING(SS_LCTL("a") "9"); } + + // secrets + if (leader_sequence_two_keys(KC_SCLN, KC_M)) { send_secret_string(0); } + if (leader_sequence_two_keys(KC_SCLN, KC_COMM)) { send_secret_string(1); } + if (leader_sequence_two_keys(KC_SCLN, KC_DOT)) { send_secret_string(2); } + if (leader_sequence_two_keys(KC_SCLN, KC_J)) { send_secret_string(3); } + if (leader_sequence_two_keys(KC_SCLN, KC_K)) { send_secret_string(4); } + if (leader_sequence_two_keys(KC_SCLN, KC_L)) { send_secret_string(5); } + + // fast control-C + if (leader_sequence_one_key(KC_C)) { tap_code16(C(KC_C)); } + + // neovim: terminal escape + if (leader_sequence_one_key(KC_BSLS)) { + tap_code16(C(KC_BSLS)); + tap_code16(C(KC_N)); + } +} void matrix_scan_keymap(void) { if (rgblight_is_enabled() && timer_elapsed(rgb_timer) > 1000) { @@ -248,50 +288,6 @@ void matrix_scan_keymap(void) { bspc_timer = 0; register_code(KC_BSPC); } - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // layer navigation - SEQ_ONE_KEY(KC_R) { layer_invert(_RPT); } - SEQ_ONE_KEY(KC_G) { layer_invert(_GAME); } - SEQ_ONE_KEY(KC_K) { layer_invert(_KP); } - SEQ_ONE_KEY(KC_KP_5) { layer_invert(_KP); } - - // tmux navigation - SEQ_ONE_KEY(KC_L) { SEND_STRING(SS_LCTL("a") "n"); } - SEQ_ONE_KEY(KC_H) { SEND_STRING(SS_LCTL("a") "p"); } - SEQ_ONE_KEY(KC_N) { SEND_STRING(SS_LCTL("a") "c"); } - SEQ_ONE_KEY(KC_W) { SEND_STRING(SS_LCTL("a") "x"); } - SEQ_ONE_KEY(KC_MINS) { SEND_STRING(SS_LCTL("a") "-"); } - SEQ_ONE_KEY(KC_QUOT) { SEND_STRING(SS_LCTL("a") "\""); } - SEQ_ONE_KEY(KC_1) { SEND_STRING(SS_LCTL("a") "1"); } - SEQ_ONE_KEY(KC_2) { SEND_STRING(SS_LCTL("a") "2"); } - SEQ_ONE_KEY(KC_3) { SEND_STRING(SS_LCTL("a") "3"); } - SEQ_ONE_KEY(KC_4) { SEND_STRING(SS_LCTL("a") "4"); } - SEQ_ONE_KEY(KC_5) { SEND_STRING(SS_LCTL("a") "5"); } - SEQ_ONE_KEY(KC_6) { SEND_STRING(SS_LCTL("a") "6"); } - SEQ_ONE_KEY(KC_7) { SEND_STRING(SS_LCTL("a") "7"); } - SEQ_ONE_KEY(KC_8) { SEND_STRING(SS_LCTL("a") "8"); } - SEQ_ONE_KEY(KC_9) { SEND_STRING(SS_LCTL("a") "9"); } - - // secrets - SEQ_TWO_KEYS(KC_SCLN, KC_M) { send_secret_string(0); } - SEQ_TWO_KEYS(KC_SCLN, KC_COMM) { send_secret_string(1); } - SEQ_TWO_KEYS(KC_SCLN, KC_DOT) { send_secret_string(2); } - SEQ_TWO_KEYS(KC_SCLN, KC_J) { send_secret_string(3); } - SEQ_TWO_KEYS(KC_SCLN, KC_K) { send_secret_string(4); } - SEQ_TWO_KEYS(KC_SCLN, KC_L) { send_secret_string(5); } - - // fast control-C - SEQ_ONE_KEY(KC_C) { tap_code16(C(KC_C)); } - - // neovim: terminal escape - SEQ_ONE_KEY(KC_BSLS) { - tap_code16(C(KC_BSLS)); - tap_code16(C(KC_N)); - } - } } bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c index f98873f3df..3870c6aae3 100644 --- a/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c +++ b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c @@ -418,54 +418,52 @@ void ldrkey_send_curlybrace_wrap_selection(void) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LGUI(SS_TAP(X_V)) SS_TAP(X_RIGHT)) : SEND_STRING(SS_LCTL(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LCTL(SS_TAP(X_V)) SS_TAP(X_RIGHT)); } -LEADER_EXTERNS(); +void leader_start_user(void) { + isLeader = true; +} -void matrix_scan_user(void) -{ - LEADER_DICTIONARY() - { - leading = false; - leader_end(); +void leader_end_user(void) { + isLeader = false; - /* Sequences on layer _MAIN & _MAC */ + /* Sequences on layer _MAIN & _MAC */ /* éÉ => LdrKey > / */ - SEQ_ONE_KEY(KC_SLSH) { + if (leader_sequence_one_key(KC_SLSH)) { send_french_accent(_E, _ACUTE); } /* àÀ => LdrKey > A */ - SEQ_ONE_KEY(KC_A) { + if (leader_sequence_one_key(KC_A)) { send_french_accent(_A, _GRAVE); } /* èÈ => LdrKey > E */ - SEQ_ONE_KEY(KC_E) { + if (leader_sequence_one_key(KC_E)) { send_french_accent(_E, _GRAVE); } /* ùÙ => LdrKey > U */ - SEQ_ONE_KEY(KC_U) { + if (leader_sequence_one_key(KC_U)) { send_french_accent(_U, _GRAVE); } /* â => LdrKey > A > A */ - SEQ_TWO_KEYS(KC_A, KC_A) { + if (leader_sequence_two_keys(KC_A, KC_A)) { send_french_accent(_A, _CIRCUMFLEX); } /* êÊ => LdrKey > E > E */ - SEQ_TWO_KEYS(KC_E, KC_E) { + if (leader_sequence_two_keys(KC_E, KC_E)) { send_french_accent(_E, _CIRCUMFLEX); } /* îÎ => LdrKey > I > I */ - SEQ_TWO_KEYS(KC_I, KC_I) { + if (leader_sequence_two_keys(KC_I, KC_I)) { send_french_accent(_I, _CIRCUMFLEX); } /* ôÔ => LdrKey > O > O */ - SEQ_TWO_KEYS(KC_O, KC_O) { + if (leader_sequence_two_keys(KC_O, KC_O)) { send_french_accent(_O, _CIRCUMFLEX); } /* ûÛ => LdrKey > U > U */ - SEQ_TWO_KEYS(KC_U, KC_U) { + if (leader_sequence_two_keys(KC_U, KC_U)) { send_french_accent(_U, _CIRCUMFLEX); } /* çÇ => LdrKey > C */ - SEQ_ONE_KEY(KC_C) { + if (leader_sequence_one_key(KC_C)) { if (onMac) { SEND_STRING(SS_LALT("c")); } else { @@ -473,247 +471,238 @@ void matrix_scan_user(void) } } /* CapsLock */ - SEQ_ONE_KEY(QK_LEAD) { + if (leader_sequence_one_key(QK_LEAD)) { tap_code(KC_CAPS); } /* ± => LdrKey > = > - */ - SEQ_TWO_KEYS(KC_EQL, KC_MINS) { + if (leader_sequence_two_keys(KC_EQL, KC_MINS)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_EQL)))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P1) SS_UP(X_LALT)); } /* ≤ => LdrKey > - > = */ - SEQ_TWO_KEYS(KC_MINS, KC_EQL) { + if (leader_sequence_two_keys(KC_MINS, KC_EQL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_COMM))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P3) SS_UP(X_LALT)); } /* ≥ => LdrKey > = > = */ - SEQ_TWO_KEYS(KC_EQL, KC_EQL) { + if (leader_sequence_two_keys(KC_EQL, KC_EQL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_DOT))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P2) SS_UP(X_LALT)); } /* <= => LdrKey > , > , */ - SEQ_TWO_KEYS(KC_COMM, KC_COMM) { + if (leader_sequence_two_keys(KC_COMM, KC_COMM)) { SEND_STRING(SS_LSFT(SS_TAP(X_COMM)) SS_TAP(X_SPC) SS_TAP(X_EQL) SS_TAP(X_LEFT) SS_TAP(X_BSPC) SS_TAP(X_RIGHT)); } /* => => LdrKey > . > . */ - SEQ_TWO_KEYS(KC_DOT, KC_DOT) { + if (leader_sequence_two_keys(KC_DOT, KC_DOT)) { SEND_STRING("=>"); } /* ", " => LdrKey > " " */ - SEQ_ONE_KEY(KC_SPC) { + if (leader_sequence_one_key(KC_SPC)) { SEND_STRING(", "); } /* ". " => LdrKey > " " > " " */ - SEQ_TWO_KEYS(KC_SPC, KC_SPC) { + if (leader_sequence_two_keys(KC_SPC, KC_SPC)) { SEND_STRING(". "); } /* Backward delete current word (on cursor) */ - SEQ_TWO_KEYS(KC_BSPC, KC_BSPC) { + if (leader_sequence_two_keys(KC_BSPC, KC_BSPC)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_RIGHT)) SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT)) SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)); } /* Previous word delete */ - SEQ_ONE_KEY(KC_BSPC) { + if (leader_sequence_one_key(KC_BSPC)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)); } /* Forward delete current word (on cursor) */ - SEQ_TWO_KEYS(KC_DEL, KC_DEL) { + if (leader_sequence_two_keys(KC_DEL, KC_DEL)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)) : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)); } /* Next word delete */ - SEQ_ONE_KEY(KC_DEL) { + if (leader_sequence_one_key(KC_DEL)) { onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)): SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)); } /* ` => LdrKey > Escape */ - SEQ_ONE_KEY(QK_GESC) { + if (leader_sequence_one_key(QK_GESC)) { SEND_STRING("`"); } /* ``` => LdrKey > Escape > Escape > Escape */ - SEQ_THREE_KEYS(QK_GESC, QK_GESC, QK_GESC) { + if (leader_sequence_three_keys(QK_GESC, QK_GESC, QK_GESC)) { SEND_STRING("```"); } /* Printscreen => LdrKey > Insert */ - SEQ_ONE_KEY(KC_INS) { + if (leader_sequence_one_key(KC_INS)) { onMac ? SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))) : SEND_STRING(SS_TAP(X_PSCR)); } /* Home => LdrKey > Page Up */ - SEQ_ONE_KEY(KC_PGUP) { + if (leader_sequence_one_key(KC_PGUP)) { onMac ? SEND_STRING(SS_TAP(X_HOME)) : SEND_STRING(SS_LCTL(SS_TAP(X_HOME))); } /* End => LdrKey > Page Down */ - SEQ_ONE_KEY(KC_PGDN) { + if (leader_sequence_one_key(KC_PGDN)) { onMac ? SEND_STRING(SS_TAP(X_END)) : SEND_STRING(SS_LCTL(SS_TAP(X_END))); } /* Close Curernt File/Tab => LdrKey > W */ - SEQ_ONE_KEY(KC_W) { + if (leader_sequence_one_key(KC_W)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_W))) : SEND_STRING(SS_LCTL(SS_TAP(X_W))); } /* Close Current App => LdrKey > Q */ - SEQ_ONE_KEY(KC_Q) { + if (leader_sequence_one_key(KC_Q)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_Q))) : SEND_STRING(SS_LALT(SS_TAP(X_F4))); } /* " => LdrKey > ' */ - SEQ_ONE_KEY(KC_QUOT) { + if (leader_sequence_one_key(KC_QUOT)) { SEND_STRING("\""); } /* "|" => LdrKey > ' > ' */ - SEQ_TWO_KEYS(KC_QUOT, KC_QUOT) { + if (leader_sequence_two_keys(KC_QUOT, KC_QUOT)) { SEND_STRING("\"\"" SS_TAP(X_LEFT)); } /* "X" wrap => LdrKey > ' > ' > ' */ - SEQ_THREE_KEYS(KC_QUOT, KC_QUOT, KC_QUOT) { + if (leader_sequence_three_keys(KC_QUOT, KC_QUOT, KC_QUOT)) { onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "\"" SS_LALT(SS_TAP(X_RIGHT)) "\"") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "\"" SS_LCTL(SS_TAP(X_RIGHT)) "\""); } /* ( => LdrKey > Left Shift */ - SEQ_ONE_KEY(KC_LSFT) { + if (leader_sequence_one_key(KC_LSFT)) { SEND_STRING("("); } /* ) => LdrKey > Right Shift */ - SEQ_ONE_KEY(KC_RSFT) { + if (leader_sequence_one_key(KC_RSFT)) { SEND_STRING(")"); } /* (|) => LdrKey > Left Shift > Left Shift */ - SEQ_TWO_KEYS(KC_LSFT, KC_LSFT) { + if (leader_sequence_two_keys(KC_LSFT, KC_LSFT)) { ldrkey_send_paranthesis_wrap_ini(); } /* (|) => LdrKey > Right Shift > Right Shift */ - SEQ_TWO_KEYS(KC_RSFT, KC_RSFT) { + if (leader_sequence_two_keys(KC_RSFT, KC_RSFT)) { ldrkey_send_paranthesis_wrap_ini(); } /* (X) wrap => LdrKey > Left Shift > W */ - SEQ_TWO_KEYS(KC_LSFT, KC_W) { + if (leader_sequence_two_keys(KC_LSFT, KC_W)) { ldrkey_send_paranthesis_wrap_word(); } /* (X) wrap => LdrKey > Right Shift > W */ - SEQ_TWO_KEYS(KC_RSFT, KC_W) { + if (leader_sequence_two_keys(KC_RSFT, KC_W)) { ldrkey_send_paranthesis_wrap_word(); } /* (X) wrap selection => LdrKey > Left Shift > W > W */ - SEQ_THREE_KEYS(KC_LSFT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LSFT, KC_W, KC_W)) { ldrkey_send_paranthesis_wrap_selection(); } /* (X) wrap selection => LdrKey > Right Shift > W > W */ - SEQ_THREE_KEYS(KC_RSFT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RSFT, KC_W, KC_W)) { ldrkey_send_paranthesis_wrap_selection(); } /* [ => LdrKey > Left CTL */ - SEQ_ONE_KEY(KC_LCTL) { + if (leader_sequence_one_key(KC_LCTL)) { SEND_STRING("["); } /* ] => LdrKey > Right CTL */ - SEQ_ONE_KEY(KC_RCTL) { + if (leader_sequence_one_key(KC_RCTL)) { SEND_STRING("]"); } /* [|] => LdrKey > Left CTL > Left CTL */ - SEQ_TWO_KEYS(KC_LCTL, KC_LCTL) { + if (leader_sequence_two_keys(KC_LCTL, KC_LCTL)) { ldrkey_send_bracket_wrap_ini(); } /* [|] => LdrKey > Right CTL > Right CTL */ - SEQ_TWO_KEYS(KC_RCTL, KC_RCTL) { + if (leader_sequence_two_keys(KC_RCTL, KC_RCTL)) { ldrkey_send_bracket_wrap_ini(); } /* [X] wrap => LdrKey > Left CTL > W */ - SEQ_TWO_KEYS(KC_LCTL, KC_W) { + if (leader_sequence_two_keys(KC_LCTL, KC_W)) { ldrkey_send_bracket_wrap_word(); } /* [X] wrap => LdrKey > Right CTL > W */ - SEQ_TWO_KEYS(KC_RCTL, KC_W) { + if (leader_sequence_two_keys(KC_RCTL, KC_W)) { ldrkey_send_bracket_wrap_word(); } /* [X] wrap selection => LdrKey > Left CTL > W > W */ - SEQ_THREE_KEYS(KC_LCTL, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LCTL, KC_W, KC_W)) { ldrkey_send_bracket_wrap_selection(); } /* [X] wrap selection => LdrKey > Right CTL > W > W */ - SEQ_THREE_KEYS(KC_RCTL, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RCTL, KC_W, KC_W)) { ldrkey_send_bracket_wrap_selection(); } /* { => LdrKey > Left ALT */ - SEQ_ONE_KEY(KC_LALT) { + if (leader_sequence_one_key(KC_LALT)) { SEND_STRING("{"); } /* } => LdrKey > Right ALT */ - SEQ_ONE_KEY(KC_RALT) { + if (leader_sequence_one_key(KC_RALT)) { SEND_STRING("}"); } /* {|} => LdrKey > Left ALT > Left ALT */ - SEQ_TWO_KEYS(KC_LALT, KC_LALT) { + if (leader_sequence_two_keys(KC_LALT, KC_LALT)) { ldrkey_send_curlybrace_wrap_ini(); } /* {|} => LdrKey > Right ALT > Right ALT */ - SEQ_TWO_KEYS(KC_RALT, KC_RALT) { + if (leader_sequence_two_keys(KC_RALT, KC_RALT)) { ldrkey_send_curlybrace_wrap_ini(); } /* {X} wrap => LdrKey > Left ALT > W */ - SEQ_TWO_KEYS(KC_LALT, KC_W) { + if (leader_sequence_two_keys(KC_LALT, KC_W)) { ldrkey_send_curlybrace_wrap_word(); } /* {X} wrap => LdrKey > Right ALT > W */ - SEQ_TWO_KEYS(KC_RALT, KC_W) { + if (leader_sequence_two_keys(KC_RALT, KC_W)) { ldrkey_send_curlybrace_wrap_word(); } /* {X} wrap selection => LdrKey > Left ALT > W > W */ - SEQ_THREE_KEYS(KC_LALT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_LALT, KC_W, KC_W)) { ldrkey_send_curlybrace_wrap_selection(); } /* {X} wrap selection => LdrKey > Right ALT > W > W */ - SEQ_THREE_KEYS(KC_RALT, KC_W, KC_W) { + if (leader_sequence_three_keys(KC_RALT, KC_W, KC_W)) { ldrkey_send_curlybrace_wrap_selection(); } /* Select everything on this line before cursor => LdrKey > Left */ - SEQ_ONE_KEY(KC_LEFT) { + if (leader_sequence_one_key(KC_LEFT)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_LEFT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_HOME))); } /* Select everything on this line after cursor => LdrKey > Right */ - SEQ_ONE_KEY(KC_RIGHT) { + if (leader_sequence_one_key(KC_RIGHT)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_END))); } /* Select everything on this line before cursor and bring on previous line => LdrKey > Left > Left */ - SEQ_TWO_KEYS(KC_LEFT, KC_LEFT) { + if (leader_sequence_two_keys(KC_LEFT, KC_LEFT)) { onMac ? SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_TAP(X_END))); } /* Select everything on this line => LdrKey > Right > Left */ - SEQ_TWO_KEYS(KC_RIGHT, KC_LEFT) { + if (leader_sequence_two_keys(KC_RIGHT, KC_LEFT)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_RIGHT) SS_LSFT(SS_LGUI(SS_TAP(X_LEFT))))) : SEND_STRING(SS_TAP(X_END) SS_LSFT(SS_TAP(X_HOME))); } /* Select 1x Page Up on the page before the cursor => LdrKey > Up */ - SEQ_ONE_KEY(KC_UP) { + if (leader_sequence_one_key(KC_UP)) { SEND_STRING(SS_LSFT(SS_TAP(X_PGUP))); } /* Select 1x Page Down on the page after the cursor => LdrKey > Down */ - SEQ_ONE_KEY(KC_DOWN) { + if (leader_sequence_one_key(KC_DOWN)) { SEND_STRING(SS_LSFT(SS_TAP(X_PGDN))); } /* Select everything on the page before the cursor => LdrKey > Up > Up */ - SEQ_TWO_KEYS(KC_UP, KC_UP) { + if (leader_sequence_two_keys(KC_UP, KC_UP)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_UP)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_HOME)))); } /* Select everything on the page after the cursor => LdrKey > Down > Down */ - SEQ_TWO_KEYS(KC_DOWN, KC_DOWN) { + if (leader_sequence_two_keys(KC_DOWN, KC_DOWN)) { onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_DOWN)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_END)))); } /* HELPER => spit out the url of the layout description page on github */ - SEQ_FIVE_KEYS(QK_GESC, QK_GESC, QK_GESC, QK_GESC, QK_GESC) { + if (leader_sequence_five_keys(QK_GESC, QK_GESC, QK_GESC, QK_GESC, QK_GESC)) { SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/keyboards/dztech/dz65rgb/keymaps/drootz"); } /* google.ca => LdrKey > G > G */ - SEQ_TWO_KEYS(KC_G, KC_G) { + if (leader_sequence_two_keys(KC_G, KC_G)) { SEND_STRING("https://google.ca" SS_TAP(X_ENT)); } /* @gmail => LdrKey > M > L > T */ - SEQ_THREE_KEYS(KC_M, KC_L, KC_T) { + if (leader_sequence_three_keys(KC_M, KC_L, KC_T)) { SEND_STRING("mailto." SS_TAP(X_D) SS_TAP(X_A) SS_TAP(X_N) SS_TAP(X_I) SS_TAP(X_E) SS_TAP(X_L) SS_TAP(X_R) SS_TAP(X_A) SS_TAP(X_C) SS_TAP(X_I) SS_TAP(X_N) SS_TAP(X_E) "@gmail.com"); } /* Show Desktop => LdrKey > D */ - SEQ_ONE_KEY(KC_D) { + if (leader_sequence_one_key(KC_D)) { onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_SPC)) "Mission" SS_TAP(X_ENT)) : SEND_STRING(SS_LGUI(SS_TAP(X_D))); } - } -} - -void leader_start_user(void) { - isLeader = true; -} - -void leader_end_user(void) { - isLeader = false; } #endif /* LEADER */ diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c deleted file mode 100644 index 8d5fa00a7d..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c +++ /dev/null @@ -1,14 +0,0 @@ -LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(TD(APMR_PIPE)) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_U); - - unregister_code(KC_U); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } -} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c deleted file mode 100644 index c22670a05a..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c +++ /dev/null @@ -1 +0,0 @@ -LEADER_EXTERNS(); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c index 277821afac..fc6c99cb85 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c @@ -1,5 +1,3 @@ -#include "../leader/leader_setup.c" - bool MATRIX_SCANNED = false; void matrix_scan_user(void) { @@ -7,6 +5,16 @@ void matrix_scan_user(void) { rgblight_sethsv_noeeprom(HSV_GREEN); MATRIX_SCANNED = true; } - - #include "../leader/leader_dictionary.c" }; + +void leader_end_user(void) { + if (leader_sequence_one_key(TD(APMR_PIPE))) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } +} diff --git a/keyboards/ergodox_ez/keymaps/stamm/keymap.c b/keyboards/ergodox_ez/keymaps/stamm/keymap.c index 8a3e30f5f6..21f58b298c 100644 --- a/keyboards/ergodox_ez/keymaps/stamm/keymap.c +++ b/keyboards/ergodox_ez/keymaps/stamm/keymap.c @@ -244,7 +244,30 @@ uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { } } -LEADER_EXTERNS(); +void leader_end_user(void) { + if (leader_sequence_one_key(KC_F)) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + if (leader_sequence_one_key(KC_S)) { + SEND_STRING ("sudo -i\n"); + } + if (leader_sequence_one_key(KC_H)) { + SEND_STRING ("--help\n"); + } + if (leader_sequence_two_keys(KC_D, KC_D)) { + SEND_STRING(SS_LGUI("ac")); + /* SEND_STRING(SS_LGUI("a") SS_LGUI("c")); */ + } + if (leader_sequence_three_keys(KC_D, KC_D, KC_S)) { + SEND_STRING("https://start.duckduckgo.com\n"); + } + if (leader_sequence_two_keys(KC_A, KC_S)) { + register_code(KC_LGUI); + register_code(KC_S); + unregister_code(KC_S); + unregister_code(KC_LGUI); + } +} void matrix_scan_user(void) { if (is_alt_tab_active) { @@ -253,31 +276,4 @@ void matrix_scan_user(void) { is_alt_tab_active = false; } } - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_F) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - SEQ_ONE_KEY(KC_S) { - SEND_STRING ("sudo -i\n"); - } - SEQ_ONE_KEY(KC_H) { - SEND_STRING ("--help\n"); - } - SEQ_TWO_KEYS(KC_D, KC_D) { - SEND_STRING(SS_LGUI("ac")); - /* SEND_STRING(SS_LGUI("a") SS_LGUI("c")); */ - } - SEQ_THREE_KEYS(KC_D, KC_D, KC_S) { - SEND_STRING("https://start.duckduckgo.com\n"); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); - } - } } diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c index 885c31e8c6..1d49d91346 100644 --- a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c +++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c @@ -49,89 +49,69 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -void matrix_init_user(void) { - -} - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Close a program in i3wm - SEQ_ONE_KEY(KC_Q) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_Q); - unregister_code(KC_Q); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); - } - // Exit i3wm - SEQ_ONE_KEY(KC_E) { - register_code(KC_LGUI); - register_code(KC_LSFT); - register_code(KC_E); - unregister_code(KC_E); - unregister_code(KC_LSFT); - unregister_code(KC_LGUI); - } - // Copy selected text in suckless terminal - SEQ_ONE_KEY(KC_C) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - // Paste text in suckless terminal - SEQ_ONE_KEY(KC_V) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_V); - unregister_code(KC_V); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - // FZF shortcut to fuzzy switch directories - SEQ_ONE_KEY(KC_D) { - register_code(KC_LALT); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LALT); - } - // Send keys to bring up fuzzy process kill - SEQ_ONE_KEY(KC_K) { - SEND_STRING("kill " SS_TAP(X_TAB)); - } - // Send keys to start neovim and fuzzy search for filename - SEQ_ONE_KEY(KC_T) { - SEND_STRING("nvim "); - register_code(KC_LCTL); - register_code(KC_T); - unregister_code(KC_T); - unregister_code(KC_LCTL); - } - // Switch between windows in tmux - SEQ_ONE_KEY(KC_L) { - register_code(KC_LCTL); - register_code(KC_B); - unregister_code(KC_B); - unregister_code(KC_LCTL); - register_code(KC_L); - unregister_code(KC_L); - } +void leader_end_user() { + // Close a program in i3wm + if (leader_sequence_one_key(KC_Q)) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_Q); + unregister_code(KC_Q); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + // Exit i3wm + if (leader_sequence_one_key(KC_E)) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_E); + unregister_code(KC_E); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + // Copy selected text in suckless terminal + if (leader_sequence_one_key(KC_C)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + // Paste text in suckless terminal + if (leader_sequence_one_key(KC_V)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_V); + unregister_code(KC_V); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + // FZF shortcut to fuzzy switch directories + if (leader_sequence_one_key(KC_D)) { + register_code(KC_LALT); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LALT); + } + // Send keys to bring up fuzzy process kill + if (leader_sequence_one_key(KC_K)) { + SEND_STRING("kill " SS_TAP(X_TAB)); + } + // Send keys to start neovim and fuzzy search for filename + if (leader_sequence_one_key(KC_T)) { + SEND_STRING("nvim "); + register_code(KC_LCTL); + register_code(KC_T); + unregister_code(KC_T); + unregister_code(KC_LCTL); + } + // Switch between windows in tmux + if (leader_sequence_one_key(KC_L)) { + register_code(KC_LCTL); + register_code(KC_B); + unregister_code(KC_B); + unregister_code(KC_LCTL); + register_code(KC_L); + unregister_code(KC_L); } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - } diff --git a/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c b/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c index 1b8e41de0e..1852920345 100644 --- a/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c +++ b/keyboards/hhkb/jp/keymaps/enoch_jp/keymap.c @@ -42,25 +42,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LEFT, KC_RGHT, _______, KC_PENT, _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)}; - -/*void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_RSFT) { - register_code(KC_S); - unregister_code(KC_S); - } - SEQ_TWO_KEYS(KC_A, KC_S) { - register_code(KC_H); - unregister_code(KC_H); - } - SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { - register_code(KC_LGUI); - register_code(KC_S); - unregister_code(KC_S); - unregister_code(KC_LGUI); - } - } -}*/ diff --git a/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c index c33bf71741..c030738400 100644 --- a/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c +++ b/keyboards/ibnuda/squiggle/keymaps/rick-complicated/keymap.c @@ -181,15 +181,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_U) { - SEND_STRING(":luvu:\n"); +void leader_end_user(void) { + if (leader_sequence_one_key(KC_U)) { + SEND_STRING(":luvu:\n"); } - } } diff --git a/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c index be1edfc019..a345e075d9 100644 --- a/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c +++ b/keyboards/input_club/ergodox_infinity/keymaps/not-quite-neo/keymap.c @@ -255,38 +255,29 @@ L06 -> : UNSPECIFIED }; +void leader_end_user(void) { + if (leader_sequence_one_key(KC_1)) { + // ¯\_(ツ)_/¯ + unicode_input_start(); register_hex(0xaf); unicode_input_finish(); + register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + } + + if (leader_sequence_one_key(KC_2)) { + // 凸(ツ)凸 + unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); + } +} + // Runs just one time when the keyboard initializes. void matrix_init_user(void) { set_unicode_input_mode(UNICODE_MODE_LINUX); }; - - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY (KC_1) { - // ¯\_(ツ)_/¯ - unicode_input_start(); register_hex(0xaf); unicode_input_finish(); - register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); - register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0xaf); unicode_input_finish(); - } - - SEQ_ONE_KEY (KC_2) { - // 凸(ツ)凸 - unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); - } - } -} diff --git a/keyboards/keebio/iris/keymaps/omgvee/keymap.c b/keyboards/keebio/iris/keymaps/omgvee/keymap.c index 4276938b8d..035d381bac 100644 --- a/keyboards/keebio/iris/keymaps/omgvee/keymap.c +++ b/keyboards/keebio/iris/keymaps/omgvee/keymap.c @@ -32,9 +32,6 @@ enum custom_keycodes { #define MW_L KC_MS_WH_LEFT #define MW_R KC_MS_WH_RIGHT -//// only uncomment the below line when you enable leader key in rules.mk -//LEADER_EXTERNS(); - //Tap Dance Declarations enum { TD_SCL = 0 diff --git a/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c b/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c index 9cfc26d138..b97e6bfb92 100644 --- a/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/victorsavu3/keymap.c @@ -76,68 +76,62 @@ static bool wiggle_mouse; static uint16_t wiggle_timer; static uint16_t next_wiggle; +void leader_end_user(void) { + if (leader_sequence_one_key(QK_LEAD)) { + tap_code(KC_CAPS); + } -LEADER_EXTERNS(); + if (leader_sequence_four_keys(KC_I, KC_D, KC_L, KC_E)) { + wiggle_mouse = !wiggle_mouse; + wiggle_timer = timer_read(); + } -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(QK_LEAD) { - tap_code(KC_CAPS); - } - - SEQ_FOUR_KEYS(KC_I, KC_D, KC_L, KC_E) { - wiggle_mouse = !wiggle_mouse; - wiggle_timer = timer_read(); - } - - SEQ_TWO_KEYS(KC_O, KC_K) { - send_unicode_string("👍"); - } - - SEQ_THREE_KEYS(KC_S, KC_A, KC_D) { - send_unicode_string("😞"); - } - - SEQ_FIVE_KEYS(KC_C, KC_H, KC_E, KC_C, KC_K) { - send_unicode_string("✅"); - } - - SEQ_FIVE_KEYS(KC_C, KC_R, KC_O, KC_S, KC_S) { - send_unicode_string("❎"); - } - - SEQ_FIVE_KEYS(KC_T, KC_H, KC_A, KC_N, KC_K) { - send_unicode_string("🙏"); - } - - SEQ_FIVE_KEYS(KC_S, KC_M, KC_I, KC_L, KC_E) { - send_unicode_string("😊"); - } - - SEQ_FIVE_KEYS(KC_P, KC_A, KC_R, KC_T, KC_Y) { - send_unicode_string("🎉"); - } - - SEQ_FOUR_KEYS(KC_E, KC_Y, KC_E, KC_S) { - send_unicode_string("(ಠ_ಠ)"); - } - - SEQ_FIVE_KEYS(KC_M, KC_A, KC_G, KC_I, KC_C) { - send_unicode_string("(ಠ_ಠ) 🪄 ⠁⭒*.✫.*⭒⠁"); - } - - SEQ_FIVE_KEYS(KC_T, KC_A, KC_B, KC_L, KC_E) { - send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); - } - - SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) { - send_unicode_string("¯\\_(ツ)_/¯"); - } + if (leader_sequence_two_keys(KC_O, KC_K)) { + send_unicode_string("👍"); + } + + if (leader_sequence_three_keys(KC_S, KC_A, KC_D)) { + send_unicode_string("😞"); + } + + if (leader_sequence_five_keys(KC_C, KC_H, KC_E, KC_C, KC_K)) { + send_unicode_string("✅"); + } + + if (leader_sequence_five_keys(KC_C, KC_R, KC_O, KC_S, KC_S)) { + send_unicode_string("❎"); + } + + if (leader_sequence_five_keys(KC_T, KC_H, KC_A, KC_N, KC_K)) { + send_unicode_string("🙏"); + } + + if (leader_sequence_five_keys(KC_S, KC_M, KC_I, KC_L, KC_E)) { + send_unicode_string("😊"); + } + + if (leader_sequence_five_keys(KC_P, KC_A, KC_R, KC_T, KC_Y)) { + send_unicode_string("🎉"); + } + + if (leader_sequence_four_keys(KC_E, KC_Y, KC_E, KC_S)) { + send_unicode_string("(ಠ_ಠ)"); + } + + if (leader_sequence_five_keys(KC_M, KC_A, KC_G, KC_I, KC_C)) { + send_unicode_string("(ಠ_ಠ) 🪄 ⠁⭒*.✫.*⭒⠁"); } + if (leader_sequence_five_keys(KC_T, KC_A, KC_B, KC_L, KC_E)) { + send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); + } + + if (leader_sequence_five_keys(KC_S, KC_H, KC_R, KC_U, KC_G)) { + send_unicode_string("¯\\_(ツ)_/¯"); + } +} + +void matrix_scan_user(void) { if (wiggle_mouse && timer_elapsed(wiggle_timer) > next_wiggle) { wiggle_timer = timer_read(); 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