diff options
| author | Didier Loiseau <didierloiseau+git@gmail.com> | 2016-03-08 23:14:15 +0100 |
|---|---|---|
| committer | Didier Loiseau <didierloiseau+git@gmail.com> | 2016-03-08 23:14:15 +0100 |
| commit | b7a81f041906c3c978a314987e486536be0a58cd (patch) | |
| tree | 81865fdb062f2716cb1581a856f3728fb4b09209 /tmk_core/common/action.c | |
| parent | 7d3ebd7b40b96f576fe4608b33f47329c334925b (diff) | |
| download | qmk_firmware-b7a81f041906c3c978a314987e486536be0a58cd.tar.gz qmk_firmware-b7a81f041906c3c978a314987e486536be0a58cd.zip | |
Fix #156: clear weak mods on every key press
- new macro_mods bit field for mods applied by macros
- weak_mods now only used for ACT_{L,R}MODS (i.e. LSFT, RSFT, LCTL etc.)
- clear the _weak_ mods on every key *pressed* such that LSFT etc.
can no more interfere with the next key
Diffstat (limited to 'tmk_core/common/action.c')
| -rw-r--r-- | tmk_core/common/action.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 77ea39e94..4197c53ed 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
| @@ -70,6 +70,10 @@ void process_action(keyrecord_t *record) | |||
| 70 | #endif | 70 | #endif |
| 71 | dprintln(); | 71 | dprintln(); |
| 72 | 72 | ||
| 73 | if (event.pressed) { | ||
| 74 | // clear the potential weak mods left by previously pressed keys | ||
| 75 | clear_weak_mods(); | ||
| 76 | } | ||
| 73 | switch (action.kind.id) { | 77 | switch (action.kind.id) { |
| 74 | /* Key and Mods */ | 78 | /* Key and Mods */ |
| 75 | case ACT_LMODS: | 79 | case ACT_LMODS: |
| @@ -500,6 +504,7 @@ void clear_keyboard(void) | |||
| 500 | void clear_keyboard_but_mods(void) | 504 | void clear_keyboard_but_mods(void) |
| 501 | { | 505 | { |
| 502 | clear_weak_mods(); | 506 | clear_weak_mods(); |
| 507 | clear_macro_mods(); | ||
| 503 | clear_keys(); | 508 | clear_keys(); |
| 504 | send_keyboard_report(); | 509 | send_keyboard_report(); |
| 505 | #ifdef MOUSEKEY_ENABLE | 510 | #ifdef MOUSEKEY_ENABLE |
