diff options
| author | Selene ToyKeeper <ToyKeeper@users.noreply.github.com> | 2022-10-24 23:02:21 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 22:02:21 -0700 |
| commit | e863c431f61565f41cf28fa7e981bdb3cba4f642 (patch) | |
| tree | 748ed905ab516ef389c883ad66e93f9607f8fbf3 /quantum | |
| parent | a80b886751aaddb0e030a14a82cf99b6778145b4 (diff) | |
added BS_TOGG so BS_SWAP and BS_NORM can be on a single key (#18837)
Co-authored-by: Selene ToyKeeper <git@toykeeper.net>
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/process_keycode/process_magic.c | 4 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index ae60f29bf5..50816c5261 100644 --- a/quantum/process_keycode/process_magic.c +++ b/quantum/process_keycode/process_magic.c | |||
| @@ -45,6 +45,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { | |||
| 45 | case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT: | 45 | case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT: |
| 46 | case MAGIC_TOGGLE_GUI: | 46 | case MAGIC_TOGGLE_GUI: |
| 47 | case MAGIC_TOGGLE_CONTROL_CAPSLOCK: | 47 | case MAGIC_TOGGLE_CONTROL_CAPSLOCK: |
| 48 | case MAGIC_TOGGLE_BACKSLASH_BACKSPACE: | ||
| 48 | case MAGIC_SWAP_ESCAPE_CAPSLOCK ... MAGIC_TOGGLE_ESCAPE_CAPSLOCK: | 49 | case MAGIC_SWAP_ESCAPE_CAPSLOCK ... MAGIC_TOGGLE_ESCAPE_CAPSLOCK: |
| 49 | /* keymap config */ | 50 | /* keymap config */ |
| 50 | keymap_config.raw = eeconfig_read_keymap(); | 51 | keymap_config.raw = eeconfig_read_keymap(); |
| @@ -163,6 +164,9 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { | |||
| 163 | } | 164 | } |
| 164 | #endif | 165 | #endif |
| 165 | break; | 166 | break; |
| 167 | case MAGIC_TOGGLE_BACKSLASH_BACKSPACE: | ||
| 168 | keymap_config.swap_backslash_backspace = !keymap_config.swap_backslash_backspace; | ||
| 169 | break; | ||
| 166 | case MAGIC_TOGGLE_NKRO: | 170 | case MAGIC_TOGGLE_NKRO: |
| 167 | clear_keyboard(); // clear first buffer to prevent stuck keys | 171 | clear_keyboard(); // clear first buffer to prevent stuck keys |
| 168 | keymap_config.nkro = !keymap_config.nkro; | 172 | keymap_config.nkro = !keymap_config.nkro; |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 2e2ba8cd81..7bd270cfd5 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
| @@ -615,6 +615,8 @@ enum quantum_keycodes { | |||
| 615 | AUTOCORRECT_OFF, | 615 | AUTOCORRECT_OFF, |
| 616 | AUTOCORRECT_TOGGLE, | 616 | AUTOCORRECT_TOGGLE, |
| 617 | 617 | ||
| 618 | MAGIC_TOGGLE_BACKSLASH_BACKSPACE, | ||
| 619 | |||
| 618 | // Start of custom keycode range for keyboards and keymaps - always leave at the end | 620 | // Start of custom keycode range for keyboards and keymaps - always leave at the end |
| 619 | SAFE_RANGE | 621 | SAFE_RANGE |
| 620 | }; | 622 | }; |
| @@ -731,6 +733,7 @@ enum quantum_keycodes { | |||
| 731 | 733 | ||
| 732 | #define BS_SWAP MAGIC_SWAP_BACKSLASH_BACKSPACE | 734 | #define BS_SWAP MAGIC_SWAP_BACKSLASH_BACKSPACE |
| 733 | #define BS_NORM MAGIC_UNSWAP_BACKSLASH_BACKSPACE | 735 | #define BS_NORM MAGIC_UNSWAP_BACKSLASH_BACKSPACE |
| 736 | #define BS_TOGG MAGIC_TOGGLE_BACKSLASH_BACKSPACE | ||
| 734 | 737 | ||
| 735 | #define NK_ON MAGIC_HOST_NKRO | 738 | #define NK_ON MAGIC_HOST_NKRO |
| 736 | #define NK_OFF MAGIC_UNHOST_NKRO | 739 | #define NK_OFF MAGIC_UNHOST_NKRO |
