diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/dynamic_macro.h | 4 | ||||
-rw-r--r-- | quantum/process_keycode/process_tap_dance.c | 14 | ||||
-rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 7 |
3 files changed, 22 insertions, 3 deletions
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h index f242405def..045ee95b5f 100644 --- a/quantum/dynamic_macro.h +++ b/quantum/dynamic_macro.h @@ -274,6 +274,10 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) macro_id = 0; } return false; + case DYN_MACRO_PLAY1: + case DYN_MACRO_PLAY2: + dprintln("dynamic macro: ignoring macro play key while recording"); + return false; default: /* Store the key in the macro buffer and process it normally. */ switch (macro_id) { diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index b807ec3c30..4fd45810bb 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -127,14 +127,22 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { return true; } + + void matrix_scan_tap_dance () { if (highest_td == -1) return; + uint16_t tap_user_defined; -for (int i = 0; i <= highest_td; i++) { +for (uint8_t i = 0; i <= highest_td; i++) { qk_tap_dance_action_t *action = &tap_dance_actions[i]; - - if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { + if(action->custom_tapping_term > 0 ) { + tap_user_defined = action->custom_tapping_term; + } + else{ + tap_user_defined = TAPPING_TERM; + } + if (action->state.count && timer_elapsed (action->state.timer) > tap_user_defined) { process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&action->state); } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 330809f83a..f42c154a05 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -44,6 +44,7 @@ typedef struct qk_tap_dance_user_fn_t on_reset; } fn; qk_tap_dance_state_t state; + uint16_t custom_tapping_term; void *user_data; } qk_tap_dance_action_t; @@ -68,6 +69,12 @@ typedef struct .user_data = NULL, \ } +#define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) { \ + .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \ + .user_data = NULL, \ + .custom_tapping_term = tap_specific_tapping_term, \ + } + extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ |