summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-04-12 08:27:17 -0700
committerGitHub <noreply@github.com>2020-04-12 17:27:17 +0200
commit23124b9fd1d667b3457410b771153361e22ae133 (patch)
treecc5bf6744ff5e02bb0f9c0b0e0a1808be5cc3094 /tmk_core
parenteb7fc7f9d99231e4c59dee2bef8659b089f4846a (diff)
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')
-rw-r--r--tmk_core/common/action.c2
-rw-r--r--tmk_core/common/action_tapping.c8
-rw-r--r--tmk_core/common/action_tapping.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 74db245c12..27c0abe6fa 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -324,7 +324,7 @@ void process_action(keyrecord_t *record, action_t action) {
# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY)
if (
# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
- !get_ignore_mod_tap_interrupt(get_event_keycode(record->event)) &&
+ !get_ignore_mod_tap_interrupt(get_event_keycode(record->event, false)) &&
# endif
record->tap.interrupted) {
dprint("mods_tap: tap: cancel: add_mods\n");
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index acce3ee515..34f08d8904 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -22,7 +22,7 @@
__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPING_TERM; }
# ifdef TAPPING_TERM_PER_KEY
-# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event)))
+# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_event_keycode(tapping_key.event, false)))
# else
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
# endif
@@ -122,10 +122,10 @@ bool process_tapping(keyrecord_t *keyp) {
# if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY)
else if (
# ifdef TAPPING_TERM_PER_KEY
- (get_tapping_term(get_event_keycode(tapping_key.event)) >= 500) &&
+ (get_tapping_term(get_event_keycode(tapping_key.event, false)) >= 500) &&
# endif
# ifdef PERMISSIVE_HOLD_PER_KEY
- !get_permissive_hold(get_event_keycode(tapping_key.event), keyp) &&
+ !get_permissive_hold(get_event_keycode(tapping_key.event, false), keyp) &&
# endif
IS_RELEASED(event) && waiting_buffer_typed(event)) {
debug("Tapping: End. No tap. Interfered by typing key\n");
@@ -246,7 +246,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY)
if (
# ifdef TAPPING_FORCE_HOLD_PER_KEY
- !get_tapping_force_hold(get_event_keycode(tapping_key.event), keyp) &&
+ !get_tapping_force_hold(get_event_keycode(tapping_key.event, false), keyp) &&
# endif
!tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
// sequential tap.
diff --git a/tmk_core/common/action_tapping.h b/tmk_core/common/action_tapping.h
index 509d5eabd8..5eaef1c5f0 100644
--- a/tmk_core/common/action_tapping.h
+++ b/tmk_core/common/action_tapping.h
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define WAITING_BUFFER_SIZE 8
#ifndef NO_ACTION_TAPPING
-uint16_t get_event_keycode(keyevent_t event);
+uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
uint16_t get_tapping_term(uint16_t keycode);
void action_tapping_process(keyrecord_t record);
#endif