diff options
-rw-r--r-- | docs/keycodes_magic.md | 1 | ||||
-rw-r--r-- | quantum/process_keycode/process_magic.c | 3 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/docs/keycodes_magic.md b/docs/keycodes_magic.md index 719d82031..7e1b1a4f6 100644 --- a/docs/keycodes_magic.md +++ b/docs/keycodes_magic.md | |||
@@ -24,6 +24,7 @@ | |||
24 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | | 24 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | |
25 | |`MAGIC_NO_GUI` |`GUI_OFF`|Disable the GUI keys | | 25 | |`MAGIC_NO_GUI` |`GUI_OFF`|Disable the GUI keys | |
26 | |`MAGIC_UNNO_GUI` |`GUI_ON` |Enable the GUI keys | | 26 | |`MAGIC_UNNO_GUI` |`GUI_ON` |Enable the GUI keys | |
27 | |`MAGIC_TOGGLE_GUI` |`GUI_TOG`|Toggles the status of the GUI keys | | ||
27 | |`MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap <code>`</code> and Escape | | 28 | |`MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap <code>`</code> and Escape | |
28 | |`MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap <code>`</code> and Escape | | 29 | |`MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap <code>`</code> and Escape | |
29 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | | 30 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace | |
diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index 44dd5f057..01f2fb928 100644 --- a/quantum/process_keycode/process_magic.c +++ b/quantum/process_keycode/process_magic.c | |||
@@ -164,6 +164,9 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { | |||
164 | case MAGIC_EE_HANDS_RIGHT: | 164 | case MAGIC_EE_HANDS_RIGHT: |
165 | eeconfig_update_handedness(false); | 165 | eeconfig_update_handedness(false); |
166 | break; | 166 | break; |
167 | case MAGIC_TOGGLE_GUI: | ||
168 | keymap_config.no_gui = !keymap_config.no_gui; | ||
169 | break; | ||
167 | } | 170 | } |
168 | 171 | ||
169 | eeconfig_update_keymap(keymap_config.raw); | 172 | eeconfig_update_keymap(keymap_config.raw); |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 08ed5a490..ef4b0f457 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -521,6 +521,9 @@ enum quantum_keycodes { | |||
521 | KEY_OVERRIDE_ON, | 521 | KEY_OVERRIDE_ON, |
522 | KEY_OVERRIDE_OFF, | 522 | KEY_OVERRIDE_OFF, |
523 | 523 | ||
524 | // Additional magic key | ||
525 | MAGIC_TOGGLE_GUI, | ||
526 | |||
524 | // Start of custom keycode range for keyboards and keymaps - always leave at the end | 527 | // Start of custom keycode range for keyboards and keymaps - always leave at the end |
525 | SAFE_RANGE | 528 | SAFE_RANGE |
526 | }; | 529 | }; |
@@ -694,6 +697,7 @@ enum quantum_keycodes { | |||
694 | 697 | ||
695 | #define GUI_OFF MAGIC_NO_GUI | 698 | #define GUI_OFF MAGIC_NO_GUI |
696 | #define GUI_ON MAGIC_UNNO_GUI | 699 | #define GUI_ON MAGIC_UNNO_GUI |
700 | #define GUI_TOG MAGIC_TOGGLE_GUI | ||
697 | 701 | ||
698 | #define GE_SWAP MAGIC_SWAP_GRAVE_ESC | 702 | #define GE_SWAP MAGIC_SWAP_GRAVE_ESC |
699 | #define GE_NORM MAGIC_UNSWAP_GRAVE_ESC | 703 | #define GE_NORM MAGIC_UNSWAP_GRAVE_ESC |