From a6d1db2c275f2e33e23135a6e410dbc8d19720a2 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 09:23:43 -0700 Subject: Create AG_TOGG code to toggle Alt/Gui swap. --- quantum/quantum.c | 11 +++++++++++ quantum/quantum_keycodes.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'quantum') diff --git a/quantum/quantum.c b/quantum/quantum.c index 9bf91eb865..84ccbdeaba 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -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; diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 3b87954960..050d2d275d 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -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: -- cgit v1.2.1