summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_tap_dance.c
diff options
context:
space:
mode:
authorJack Humbert2017-05-30 15:38:22 -0400
committerGitHub2017-05-30 15:38:22 -0400
commit328bde1624ecf7c5bce878398f39dd580ded5014 (patch)
tree904169689b45d99760e7b64ba03a877a07036a14 /quantum/process_keycode/process_tap_dance.c
parentcb791cf6cdbcd9fd1291f36f6b1a6840753db97f (diff)
parent3c4022c41bc69b0bec94b2f34b6958ff41924254 (diff)
Merge pull request #1323 from nikchi/master
Variable tapping terms
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.c')
-rw-r--r--quantum/process_keycode/process_tap_dance.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index b807ec3c3..4fd45810b 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);
}