Skip to content

Commit

Permalink
add cases for swapped control and OS keys to mod_config (#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
1hella committed Jun 18, 2019
1 parent 3e3fccf commit 45bf472
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions quantum/keycode_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ uint8_t mod_config(uint8_t mod) {
mod |= MOD_RGUI;
}
}
if (keymap_config.swap_lctl_lgui) {
if ((mod & MOD_RGUI) == MOD_LGUI) {
mod &= ~MOD_LGUI;
mod |= MOD_LCTL;
} else if ((mod & MOD_RCTL) == MOD_LCTL) {
mod &= ~MOD_LCTL;
mod |= MOD_LGUI;
}
}
if (keymap_config.swap_rctl_rgui) {
if ((mod & MOD_RGUI) == MOD_RGUI) {
mod &= ~MOD_RGUI;
mod |= MOD_RCTL;
} else if ((mod & MOD_RCTL) == MOD_RCTL) {
mod &= ~MOD_RCTL;
mod |= MOD_RGUI;
}
}
if (keymap_config.no_gui) {
mod &= ~MOD_LGUI;
mod &= ~MOD_RGUI;
Expand Down

0 comments on commit 45bf472

Please sign in to comment.