aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/action.c
diff options
context:
space:
mode:
authorDidier Loiseau <didierloiseau+git@gmail.com>2016-04-06 00:19:12 +0200
committerDidier Loiseau <didierloiseau+git@gmail.com>2016-04-06 00:30:50 +0200
commit08871e56f78c08340bb229300c457c852105d155 (patch)
tree49a2f34cd63d06c0f7af4add7247284ca311a6ee /tmk_core/common/action.c
parent931b0a79fc071498c229b0051be0ebadd934a549 (diff)
downloadqmk_firmware-08871e56f78c08340bb229300c457c852105d155.tar.gz
qmk_firmware-08871e56f78c08340bb229300c457c852105d155.zip
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 when pressing another key (#188) - 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.c14
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)
88 action.key.mods<<4; 88 action.key.mods<<4;
89 if (event.pressed) { 89 if (event.pressed) {
90 if (mods) { 90 if (mods) {
91 add_weak_mods(mods); 91 if (IS_MOD(action.key.code)) {
92 // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
93 // this also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT)
94 add_mods(mods);
95 } else {
96 add_weak_mods(mods);
97 }
92 send_keyboard_report(); 98 send_keyboard_report();
93 } 99 }
94 register_code(action.key.code); 100 register_code(action.key.code);
95 } else { 101 } else {
96 unregister_code(action.key.code); 102 unregister_code(action.key.code);
97 if (mods) { 103 if (mods) {
98 del_weak_mods(mods); 104 if (IS_MOD(action.key.code)) {
105 del_mods(mods);
106 } else {
107 del_weak_mods(mods);
108 }
99 send_keyboard_report(); 109 send_keyboard_report();
100 } 110 }
101 } 111 }