diff options
| author | Drashna Jaelre <drashna@live.com> | 2020-04-12 08:27:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-12 17:27:17 +0200 |
| commit | 23124b9fd1d667b3457410b771153361e22ae133 (patch) | |
| tree | cc5bf6744ff5e02bb0f9c0b0e0a1808be5cc3094 /tmk_core/common/action_tapping.c | |
| parent | eb7fc7f9d99231e4c59dee2bef8659b089f4846a (diff) | |
| download | qmk_firmware-23124b9fd1d667b3457410b771153361e22ae133.tar.gz qmk_firmware-23124b9fd1d667b3457410b771153361e22ae133.zip | |
Fix bug with layer caching in get_event_keycode (#8693)
* Fix bug with layer caching in get_event_keycode
* Improve naming
Diffstat (limited to 'tmk_core/common/action_tapping.c')
| -rw-r--r-- | tmk_core/common/action_tapping.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index acce3ee51..34f08d890 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPING_TERM; } | 22 | __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPING_TERM; } |
| 23 | 23 | ||
| 24 | # ifdef TAPPING_TERM_PER_KEY | 24 | # ifdef TAPPING_TERM_PER_KEY |
| 25 | # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event))) | 25 | # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event, false))) |
| 26 | # else | 26 | # else |
| 27 | # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM) | 27 | # define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM) |
| 28 | # endif | 28 | # endif |
| @@ -122,10 +122,10 @@ bool process_tapping(keyrecord_t *keyp) { | |||
| 122 | # if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY) | 122 | # if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY) |
| 123 | else if ( | 123 | else if ( |
| 124 | # ifdef TAPPING_TERM_PER_KEY | 124 | # ifdef TAPPING_TERM_PER_KEY |
| 125 | (get_tapping_term(get_event_keycode(tapping_key.event)) >= 500) && | 125 | (get_tapping_term(get_event_keycode(tapping_key.event, false)) >= 500) && |
| 126 | # endif | 126 | # endif |
| 127 | # ifdef PERMISSIVE_HOLD_PER_KEY | 127 | # ifdef PERMISSIVE_HOLD_PER_KEY |
| 128 | !get_permissive_hold(get_event_keycode(tapping_key.event), keyp) && | 128 | !get_permissive_hold(get_event_keycode(tapping_key.event, false), keyp) && |
| 129 | # endif | 129 | # endif |
| 130 | IS_RELEASED(event) && waiting_buffer_typed(event)) { | 130 | IS_RELEASED(event) && waiting_buffer_typed(event)) { |
| 131 | debug("Tapping: End. No tap. Interfered by typing key\n"); | 131 | debug("Tapping: End. No tap. Interfered by typing key\n"); |
| @@ -246,7 +246,7 @@ bool process_tapping(keyrecord_t *keyp) { | |||
| 246 | # if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY) | 246 | # if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY) |
| 247 | if ( | 247 | if ( |
| 248 | # ifdef TAPPING_FORCE_HOLD_PER_KEY | 248 | # ifdef TAPPING_FORCE_HOLD_PER_KEY |
| 249 | !get_tapping_force_hold(get_event_keycode(tapping_key.event), keyp) && | 249 | !get_tapping_force_hold(get_event_keycode(tapping_key.event, false), keyp) && |
| 250 | # endif | 250 | # endif |
| 251 | !tapping_key.tap.interrupted && tapping_key.tap.count > 0) { | 251 | !tapping_key.tap.interrupted && tapping_key.tap.count > 0) { |
| 252 | // sequential tap. | 252 | // sequential tap. |
