Browse Source

Create AG_TOGG code to toggle Alt/Gui swap.

pull/3826/head 0.6.121
Joe Wasson 5 years ago
committed by Drashna Jaelre
parent
commit
a6d1db2c27
4 changed files with 15 additions and 0 deletions
  1. +1
    -0
      docs/feature_bootmagic.md
  2. +1
    -0
      docs/keycodes.md
  3. +11
    -0
      quantum/quantum.c
  4. +2
    -0
      quantum/quantum_keycodes.h

+ 1
- 0
docs/feature_bootmagic.md View File

@ -57,6 +57,7 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug
|`MAGIC_UNNO_GUI` | |Enable the GUI keys |
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)|
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI |
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap |
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock |


+ 1
- 0
docs/keycodes.md View File

@ -271,6 +271,7 @@ This is a reference only. Each group of keys links to the page documenting their
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|`MAGIC_UNHOST_NKRO` | |Force NKRO off |
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides |
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides|
|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off |
## [Bluetooth](feature_bluetooth.md)


+ 11
- 0
quantum/quantum.c View File

@ -626,6 +626,17 @@ bool process_record_quantum(keyrecord_t *record) {
PLAY_SONG(ag_norm_song);
#endif
break;
case MAGIC_TOGGLE_ALT_GUI:
keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui;
keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui;
#ifdef AUDIO_ENABLE
if (keymap_config.swap_ralt_rgui) {
PLAY_SONG(ag_swap_song);
} else {
PLAY_SONG(ag_norm_song);
}
#endif
break;
case MAGIC_TOGGLE_NKRO:
keymap_config.nkro = !keymap_config.nkro;
break;


+ 2
- 0
quantum/quantum_keycodes.h View File

@ -116,6 +116,7 @@ enum quantum_keycodes {
MAGIC_UNHOST_NKRO,
MAGIC_UNSWAP_ALT_GUI,
MAGIC_TOGGLE_NKRO,
MAGIC_TOGGLE_ALT_GUI,
GRAVE_ESC,
// Leader key
@ -590,6 +591,7 @@ enum quantum_keycodes {
#define AG_SWAP MAGIC_SWAP_ALT_GUI
#define AG_NORM MAGIC_UNSWAP_ALT_GUI
#define AG_TOGG MAGIC_TOGGLE_ALT_GUI
// GOTO layer - 16 layers max
// when:


Loading…
Cancel
Save