diff options
author | Didier Loiseau <didierloiseau+git@gmail.com> | 2016-04-06 00:19:12 +0200 |
---|---|---|
committer | Didier Loiseau <didierloiseau+git@gmail.com> | 2016-04-06 01:07:36 +0200 |
commit | 8d6bbf2757d7dc085b0765feda8d67b48c6c8f8b (patch) | |
tree | 55bc928fa61ed28b1104f4e08ddcd1fc895ab22c /tmk_core/common/action.c | |
parent | db35212422f228cd9ddf68b61f47380fe1842e83 (diff) | |
download | qmk_firmware-8d6bbf2757d7dc085b0765feda8d67b48c6c8f8b.tar.gz qmk_firmware-8d6bbf2757d7dc085b0765feda8d67b48c6c8f8b.tar.xz |
Fix issue #221: LGUI(KC_LSFT) does not work
- on mod keys, register LGUI, LSFT etc. as normal mods
instead of weak mods:
- they won't be cleared by layer switching
- LSFT(KC_LGUI) will now have the same behavior as LGUI(KC_LSFT)
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 2ccc0e0b9..901089634 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -88,14 +88,24 @@ void process_action(keyrecord_t *record) action.key.mods<<4; if (event.pressed) { if (mods) { - add_weak_mods(mods); + if (IS_MOD(action.key.code)) { + // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless. + // this also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT) + add_mods(mods); + } else { + add_weak_mods(mods); + } send_keyboard_report(); } register_code(action.key.code); } else { unregister_code(action.key.code); if (mods) { - del_weak_mods(mods); + if (IS_MOD(action.key.code)) { + del_mods(mods); + } else { + del_weak_mods(mods); + } send_keyboard_report(); } } |