Fixup Bootmagic code (#6386)
This commit is contained in:
parent
8a2e328a33
commit
b5ee6c200c
@ -18,6 +18,11 @@
|
|||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
/** \brief keycode_config
|
||||||
|
*
|
||||||
|
* This function is used to check a specific keycode against the bootmagic config,
|
||||||
|
* and will return the corrected keycode, when appropriate.
|
||||||
|
*/
|
||||||
uint16_t keycode_config(uint16_t keycode) {
|
uint16_t keycode_config(uint16_t keycode) {
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
@ -109,6 +114,12 @@ uint16_t keycode_config(uint16_t keycode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief mod_config
|
||||||
|
*
|
||||||
|
* This function checks the mods passed to it against the bootmagic config,
|
||||||
|
* and will remove or replace mods, based on that.
|
||||||
|
*/
|
||||||
|
|
||||||
uint8_t mod_config(uint8_t mod) {
|
uint8_t mod_config(uint8_t mod) {
|
||||||
if (keymap_config.swap_lalt_lgui) {
|
if (keymap_config.swap_lalt_lgui) {
|
||||||
if ((mod & MOD_RGUI) == MOD_LGUI) {
|
if ((mod & MOD_RGUI) == MOD_LGUI) {
|
||||||
|
@ -613,15 +613,13 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
keymap_config.nkro = true;
|
keymap_config.nkro = true;
|
||||||
break;
|
break;
|
||||||
case MAGIC_SWAP_ALT_GUI:
|
case MAGIC_SWAP_ALT_GUI:
|
||||||
keymap_config.swap_lalt_lgui = true;
|
keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = true;
|
||||||
keymap_config.swap_ralt_rgui = true;
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
PLAY_SONG(ag_swap_song);
|
PLAY_SONG(ag_swap_song);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case MAGIC_SWAP_CTL_GUI:
|
case MAGIC_SWAP_CTL_GUI:
|
||||||
keymap_config.swap_lctl_lgui = true;
|
keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = true;
|
||||||
keymap_config.swap_rctl_rgui = true;
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
PLAY_SONG(cg_swap_song);
|
PLAY_SONG(cg_swap_song);
|
||||||
#endif
|
#endif
|
||||||
@ -657,22 +655,20 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
keymap_config.nkro = false;
|
keymap_config.nkro = false;
|
||||||
break;
|
break;
|
||||||
case MAGIC_UNSWAP_ALT_GUI:
|
case MAGIC_UNSWAP_ALT_GUI:
|
||||||
keymap_config.swap_lalt_lgui = false;
|
keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = false;
|
||||||
keymap_config.swap_ralt_rgui = false;
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
PLAY_SONG(ag_norm_song);
|
PLAY_SONG(ag_norm_song);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case MAGIC_UNSWAP_CTL_GUI:
|
case MAGIC_UNSWAP_CTL_GUI:
|
||||||
keymap_config.swap_lctl_lgui = false;
|
keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = false;
|
||||||
keymap_config.swap_rctl_rgui = false;
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
PLAY_SONG(cg_norm_song);
|
PLAY_SONG(cg_norm_song);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case MAGIC_TOGGLE_ALT_GUI:
|
case MAGIC_TOGGLE_ALT_GUI:
|
||||||
keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui;
|
keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui;
|
||||||
keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui;
|
keymap_config.swap_ralt_rgui = keymap_config.swap_lalt_lgui;
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
if (keymap_config.swap_ralt_rgui) {
|
if (keymap_config.swap_ralt_rgui) {
|
||||||
PLAY_SONG(ag_swap_song);
|
PLAY_SONG(ag_swap_song);
|
||||||
@ -683,7 +679,7 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
break;
|
break;
|
||||||
case MAGIC_TOGGLE_CTL_GUI:
|
case MAGIC_TOGGLE_CTL_GUI:
|
||||||
keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui;
|
keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui;
|
||||||
keymap_config.swap_rctl_rgui = !keymap_config.swap_rctl_rgui;
|
keymap_config.swap_rctl_rgui = keymap_config.swap_lctl_lgui;
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
if (keymap_config.swap_rctl_rgui) {
|
if (keymap_config.swap_rctl_rgui) {
|
||||||
PLAY_SONG(cg_swap_song);
|
PLAY_SONG(cg_swap_song);
|
||||||
|
Loading…
Reference in New Issue
Block a user