diff options
author | Drashna Jaelre <drashna@live.com> | 2021-08-17 15:47:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 08:47:50 +1000 |
commit | 4c4f632378867b5c3e61461333974f59170893c3 (patch) | |
tree | 8b62911e596e7a3b9aaad060174cc89b3fc52b46 /quantum | |
parent | 3b28178deb7a42a2df8c19b9bf190bb5da732b33 (diff) |
Add a toggle key for GUI On/Off in Magic feature (#13830)
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/process_keycode/process_magic.c | 3 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index 44dd5f0579..01f2fb9289 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) { case MAGIC_EE_HANDS_RIGHT: eeconfig_update_handedness(false); break; + case MAGIC_TOGGLE_GUI: + keymap_config.no_gui = !keymap_config.no_gui; + break; } eeconfig_update_keymap(keymap_config.raw); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 08ed5a490d..ef4b0f457b 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -521,6 +521,9 @@ enum quantum_keycodes { KEY_OVERRIDE_ON, KEY_OVERRIDE_OFF, + // Additional magic key + MAGIC_TOGGLE_GUI, + // Start of custom keycode range for keyboards and keymaps - always leave at the end SAFE_RANGE }; @@ -694,6 +697,7 @@ enum quantum_keycodes { #define GUI_OFF MAGIC_NO_GUI #define GUI_ON MAGIC_UNNO_GUI +#define GUI_TOG MAGIC_TOGGLE_GUI #define GE_SWAP MAGIC_SWAP_GRAVE_ESC #define GE_NORM MAGIC_UNSWAP_GRAVE_ESC |