Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a toggle key for GUI On/Off in Magic feature #13830

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/keycodes_magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides |
|`MAGIC_NO_GUI` |`GUI_OFF`|Disable the GUI keys |
|`MAGIC_UNNO_GUI` |`GUI_ON` |Enable the GUI keys |
|`MAGIC_TOGGLE_GUI` |`GUI_TOG`|Toggles the status of the GUI keys |
|`MAGIC_SWAP_GRAVE_ESC` |`GE_SWAP`|Swap <code>&#96;</code> and Escape |
|`MAGIC_UNSWAP_GRAVE_ESC` |`GE_NORM`|Unswap <code>&#96;</code> and Escape |
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |`BS_SWAP`|Swap `\` and Backspace |
Expand Down
3 changes: 3 additions & 0 deletions quantum/process_keycode/process_magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions quantum/quantum_keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,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
};
Expand Down Expand Up @@ -692,6 +695,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
Expand Down