Pass in the keyrecord_t of the dual-role/tapping key when calling per-key tap hold functions (#15938)

* Replace keyp by &tapping_key in the record arg of per-key tap hold funcs

* Replace NULL by &(keyrecord_t){} in 2nd arg of get_tapping_term
This commit is contained in:
precondition 2022-02-11 20:53:26 +01:00 committed by GitHub
parent 39bec3bfa5
commit 7148a69d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -124,7 +124,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
|| ( || (
# ifdef RETRO_TAPPING_PER_KEY # ifdef RETRO_TAPPING_PER_KEY
get_retro_tapping(tapping_keycode, keyp) && get_retro_tapping(tapping_keycode, &tapping_key) &&
# endif # endif
(RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0)
) )
@ -158,7 +158,7 @@ bool process_tapping(keyrecord_t *keyp) {
( (
( (
# ifdef TAPPING_TERM_PER_KEY # ifdef TAPPING_TERM_PER_KEY
get_tapping_term(tapping_keycode, keyp) get_tapping_term(tapping_keycode, &tapping_key)
# else # else
g_tapping_term g_tapping_term
# endif # endif
@ -166,7 +166,7 @@ bool process_tapping(keyrecord_t *keyp) {
) )
# ifdef PERMISSIVE_HOLD_PER_KEY # ifdef PERMISSIVE_HOLD_PER_KEY
|| get_permissive_hold(tapping_keycode, keyp) || get_permissive_hold(tapping_keycode, &tapping_key)
# elif defined(PERMISSIVE_HOLD) # elif defined(PERMISSIVE_HOLD)
|| true || true
# endif # endif
@ -177,7 +177,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
|| ( || (
# ifdef RETRO_TAPPING_PER_KEY # ifdef RETRO_TAPPING_PER_KEY
get_retro_tapping(tapping_keycode, keyp) && get_retro_tapping(tapping_keycode, &tapping_key) &&
# endif # endif
( (
// Rolled over the two keys. // Rolled over the two keys.
@ -188,7 +188,7 @@ bool process_tapping(keyrecord_t *keyp) {
|| ( || (
IS_LT(tapping_keycode) IS_LT(tapping_keycode)
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY # ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
&& get_hold_on_other_key_press(tapping_keycode, keyp) && get_hold_on_other_key_press(tapping_keycode, &tapping_key)
# endif # endif
) )
# endif # endif
@ -196,7 +196,7 @@ bool process_tapping(keyrecord_t *keyp) {
|| ( || (
IS_MT(tapping_keycode) IS_MT(tapping_keycode)
# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY # ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
&& !get_ignore_mod_tap_interrupt(tapping_keycode, keyp) && !get_ignore_mod_tap_interrupt(tapping_keycode, &tapping_key)
# endif # endif
) )
# endif # endif
@ -252,7 +252,7 @@ bool process_tapping(keyrecord_t *keyp) {
tapping_key.tap.interrupted = true; tapping_key.tap.interrupted = true;
# if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) # if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
# if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) # if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
if (get_hold_on_other_key_press(tapping_keycode, keyp)) if (get_hold_on_other_key_press(tapping_keycode, &tapping_key))
# endif # endif
{ {
debug("Tapping: End. No tap. Interfered by pressed key\n"); debug("Tapping: End. No tap. Interfered by pressed key\n");
@ -360,7 +360,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) # if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
|| ( || (
# ifdef RETRO_TAPPING_PER_KEY # ifdef RETRO_TAPPING_PER_KEY
get_retro_tapping(tapping_keycode, keyp) && get_retro_tapping(tapping_keycode, &tapping_key) &&
# endif # endif
(RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0) (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16(event.time, tapping_key.event.time) < (RETRO_SHIFT + 0)
) )
@ -373,7 +373,7 @@ bool process_tapping(keyrecord_t *keyp) {
# if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY) # if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY)
if ( if (
# ifdef TAPPING_FORCE_HOLD_PER_KEY # ifdef TAPPING_FORCE_HOLD_PER_KEY
!get_tapping_force_hold(tapping_keycode, keyp) && !get_tapping_force_hold(tapping_keycode, &tapping_key) &&
# endif # endif
!tapping_key.tap.interrupted && tapping_key.tap.count > 0) { !tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
// sequential tap. // sequential tap.

View File

@ -101,7 +101,7 @@ const pointing_device_driver_t pointing_device_driver = {
# ifdef TAPPING_TERM_PER_KEY # ifdef TAPPING_TERM_PER_KEY
# include "action.h" # include "action.h"
# include "action_tapping.h" # include "action_tapping.h"
# define CIRQUE_PINNACLE_TAPPING_TERM get_tapping_term(KC_BTN1, NULL) # define CIRQUE_PINNACLE_TAPPING_TERM get_tapping_term(KC_BTN1, &(keyrecord_t){})
# else # else
# ifdef TAPPING_TERM # ifdef TAPPING_TERM
# define CIRQUE_PINNACLE_TAPPING_TERM TAPPING_TERM # define CIRQUE_PINNACLE_TAPPING_TERM TAPPING_TERM

View File

@ -173,7 +173,7 @@ void tap_dance_task() {
tap_user_defined = action->custom_tapping_term; tap_user_defined = action->custom_tapping_term;
} else { } else {
#ifdef TAPPING_TERM_PER_KEY #ifdef TAPPING_TERM_PER_KEY
tap_user_defined = get_tapping_term(action->state.keycode, NULL); tap_user_defined = get_tapping_term(action->state.keycode, &(keyrecord_t){});
#else #else
tap_user_defined = TAPPING_TERM; tap_user_defined = TAPPING_TERM;
#endif #endif