diff options
-rw-r--r-- | docs/feature_bootmagic.md | 1 | ||||
-rw-r--r-- | docs/keycodes.md | 1 | ||||
-rw-r--r-- | quantum/quantum.c | 11 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 2 |
4 files changed, 15 insertions, 0 deletions
diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index d6915d355..586b5d837 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md | |||
@@ -57,6 +57,7 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug | |||
57 | |`MAGIC_UNNO_GUI` | |Enable the GUI keys | | 57 | |`MAGIC_UNNO_GUI` | |Enable the GUI keys | |
58 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| | 58 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| |
59 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | | 59 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | |
60 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap | | ||
60 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | | 61 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |
61 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | | 62 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |
62 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | | 63 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | |
diff --git a/docs/keycodes.md b/docs/keycodes.md index c344a7528..6676bb53c 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md | |||
@@ -271,6 +271,7 @@ This is a reference only. Each group of keys links to the page documenting their | |||
271 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | | 271 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |
272 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | | 272 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | |
273 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | | 273 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | |
274 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides| | ||
274 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | | 275 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | |
275 | 276 | ||
276 | ## [Bluetooth](feature_bluetooth.md) | 277 | ## [Bluetooth](feature_bluetooth.md) |
diff --git a/quantum/quantum.c b/quantum/quantum.c index 9bf91eb86..84ccbdeab 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -626,6 +626,17 @@ bool process_record_quantum(keyrecord_t *record) { | |||
626 | PLAY_SONG(ag_norm_song); | 626 | PLAY_SONG(ag_norm_song); |
627 | #endif | 627 | #endif |
628 | break; | 628 | break; |
629 | case MAGIC_TOGGLE_ALT_GUI: | ||
630 | keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; | ||
631 | keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui; | ||
632 | #ifdef AUDIO_ENABLE | ||
633 | if (keymap_config.swap_ralt_rgui) { | ||
634 | PLAY_SONG(ag_swap_song); | ||
635 | } else { | ||
636 | PLAY_SONG(ag_norm_song); | ||
637 | } | ||
638 | #endif | ||
639 | break; | ||
629 | case MAGIC_TOGGLE_NKRO: | 640 | case MAGIC_TOGGLE_NKRO: |
630 | keymap_config.nkro = !keymap_config.nkro; | 641 | keymap_config.nkro = !keymap_config.nkro; |
631 | break; | 642 | break; |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 3b8795496..050d2d275 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -116,6 +116,7 @@ enum quantum_keycodes { | |||
116 | MAGIC_UNHOST_NKRO, | 116 | MAGIC_UNHOST_NKRO, |
117 | MAGIC_UNSWAP_ALT_GUI, | 117 | MAGIC_UNSWAP_ALT_GUI, |
118 | MAGIC_TOGGLE_NKRO, | 118 | MAGIC_TOGGLE_NKRO, |
119 | MAGIC_TOGGLE_ALT_GUI, | ||
119 | GRAVE_ESC, | 120 | GRAVE_ESC, |
120 | 121 | ||
121 | // Leader key | 122 | // Leader key |
@@ -590,6 +591,7 @@ enum quantum_keycodes { | |||
590 | 591 | ||
591 | #define AG_SWAP MAGIC_SWAP_ALT_GUI | 592 | #define AG_SWAP MAGIC_SWAP_ALT_GUI |
592 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI | 593 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI |
594 | #define AG_TOGG MAGIC_TOGGLE_ALT_GUI | ||
593 | 595 | ||
594 | // GOTO layer - 16 layers max | 596 | // GOTO layer - 16 layers max |
595 | // when: | 597 | // when: |