diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-02-06 18:57:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-06 18:57:23 -0500 |
| commit | b6ffda484971306264c8c95facf75eec4c85b62a (patch) | |
| tree | 90310202cf0701a022fcbed62715a711af8f7e7d /tmk_core | |
| parent | 449ab9109ab0d04944de8430d8d910cf7f1e8856 (diff) | |
| parent | 45e0d09414c09c626d2349b6a5036a29fe03b1c6 (diff) | |
| download | qmk_firmware-b6ffda484971306264c8c95facf75eec4c85b62a.tar.gz qmk_firmware-b6ffda484971306264c8c95facf75eec4c85b62a.zip | |
Merge pull request #1010 from SjB/oneshot_timeout_fix
oneshot timeout would only timeout after an event.
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/action.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index d485b46c7..f03670a7f 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
| @@ -49,6 +49,13 @@ void action_exec(keyevent_t event) | |||
| 49 | 49 | ||
| 50 | keyrecord_t record = { .event = event }; | 50 | keyrecord_t record = { .event = event }; |
| 51 | 51 | ||
| 52 | #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | ||
| 53 | if (has_oneshot_layer_timed_out()) { | ||
| 54 | dprintf("Oneshot layer: timeout\n"); | ||
| 55 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | ||
| 56 | } | ||
| 57 | #endif | ||
| 58 | |||
| 52 | #ifndef NO_ACTION_TAPPING | 59 | #ifndef NO_ACTION_TAPPING |
| 53 | action_tapping_process(record); | 60 | action_tapping_process(record); |
| 54 | #else | 61 | #else |
| @@ -100,7 +107,7 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 100 | return true; | 107 | return true; |
| 101 | } | 108 | } |
| 102 | 109 | ||
| 103 | void process_record(keyrecord_t *record) | 110 | void process_record(keyrecord_t *record) |
| 104 | { | 111 | { |
| 105 | if (IS_NOEVENT(record->event)) { return; } | 112 | if (IS_NOEVENT(record->event)) { return; } |
| 106 | 113 | ||
| @@ -126,13 +133,6 @@ void process_action(keyrecord_t *record, action_t action) | |||
| 126 | uint8_t tap_count = record->tap.count; | 133 | uint8_t tap_count = record->tap.count; |
| 127 | #endif | 134 | #endif |
| 128 | 135 | ||
| 129 | #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | ||
| 130 | if (has_oneshot_layer_timed_out()) { | ||
| 131 | dprintf("Oneshot layer: timeout\n"); | ||
| 132 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | ||
| 133 | } | ||
| 134 | #endif | ||
| 135 | |||
| 136 | if (event.pressed) { | 136 | if (event.pressed) { |
| 137 | // clear the potential weak mods left by previously pressed keys | 137 | // clear the potential weak mods left by previously pressed keys |
| 138 | clear_weak_mods(); | 138 | clear_weak_mods(); |
