summaryrefslogtreecommitdiffstats
path: root/quantum/keycode_config.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-06-27 14:21:42 -0400
committerJack Humbert <jack.humb@gmail.com>2017-06-27 14:21:42 -0400
commit9f5b4e1d7a37f873acbc19b8385964121566653e (patch)
tree78a51918d16a84148af5276170d2c30525dee661 /quantum/keycode_config.c
parentb82604dadad81872abdb9fdde18086ee69e66671 (diff)
parent4ba9438c3f71e6ea3433be4f9e1a28d36471d247 (diff)
Merge branch 'master' of https://github.com/qmk/qmk_firmware into dual_audio
Diffstat (limited to 'quantum/keycode_config.c')
-rw-r--r--quantum/keycode_config.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/quantum/keycode_config.c b/quantum/keycode_config.c
index 4f7bc525ec..eb39c8fe00 100644
--- a/quantum/keycode_config.c
+++ b/quantum/keycode_config.c
@@ -88,3 +88,31 @@ uint16_t keycode_config(uint16_t keycode) {
return keycode;
}
}
+
+uint8_t mod_config(uint8_t mod) {
+ keymap_config.raw = eeconfig_read_keymap();
+ if (keymap_config.swap_lalt_lgui) {
+ if ((mod & MOD_RGUI) == MOD_LGUI) {
+ mod &= ~MOD_LGUI;
+ mod |= MOD_LALT;
+ } else if ((mod & MOD_RALT) == MOD_LALT) {
+ mod &= ~MOD_LALT;
+ mod |= MOD_LGUI;
+ }
+ }
+ if (keymap_config.swap_ralt_rgui) {
+ if ((mod & MOD_RGUI) == MOD_RGUI) {
+ mod &= ~MOD_RGUI;
+ mod |= MOD_RALT;
+ } else if ((mod & MOD_RALT) == MOD_RALT) {
+ mod &= ~MOD_RALT;
+ mod |= MOD_RGUI;
+ }
+ }
+ if (keymap_config.no_gui) {
+ mod &= ~MOD_LGUI;
+ mod &= ~MOD_RGUI;
+ }
+
+ return mod;
+} \ No newline at end of file