summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorErez Zukerman <bulk@ezuk.org>2016-04-06 22:37:02 +0300
committerErez Zukerman <bulk@ezuk.org>2016-04-06 22:37:02 +0300
commit27ee47d0bd467e86e36feff8c66b3aea661f91b5 (patch)
tree8fbd84340d6951b9148b0347d760ca5987e90b49 /tmk_core
parentd07a1257b3fc815c257fd8f09faf1417c8429778 (diff)
parent08871e56f78c08340bb229300c457c852105d155 (diff)
Merge pull request #239 from DidierLoiseau/issue-221
Fix issue #221: LGUI(KC_LSFT) does not work
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 2ccc0e0b94..9010896343 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();
}
}