summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorNick Choi <iinikchi@gmail.com>2017-05-25 00:41:00 -0400
committerNick Choi <iinikchi@gmail.com>2017-05-25 00:41:00 -0400
commite695b5a33b97cfb4f9dd8bc8ecaff8aa7e0f14cc (patch)
tree3bbf264d0c3fdce8d4354a801637c6c923bb8299 /quantum
parent17a378715ebfe74f4e7b22520ab7626054f9f677 (diff)
downloadqmk_firmware-e695b5a33b97cfb4f9dd8bc8ecaff8aa7e0f14cc.tar.gz
qmk_firmware-e695b5a33b97cfb4f9dd8bc8ecaff8aa7e0f14cc.zip
Added per case tapping term, updated FF-nikchi keymap.
Diffstat (limited to 'quantum')
-rw-r--r--quantum/process_keycode/process_tap_dance.c10
-rw-r--r--quantum/process_keycode/process_tap_dance.h4
2 files changed, 10 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index b807ec3c30..e58b6f2dfe 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -130,11 +130,17 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
void matrix_scan_tap_dance () {
if (highest_td == -1)
return;
+ int tap_user_defined;
for (int 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->user_data != NULL ) {
+ tap_user_defined = (int)action->user_data;
+ }
+ 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..95d51f4806 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -63,9 +63,9 @@ typedef struct
.user_data = NULL, \
}
-#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) { \
+#define ACTION_TAP_DANCE_FN_ADVANCED(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, \
+ .user_data = (void *)(tap_specific_tapping_term), \
}
extern qk_tap_dance_action_t tap_dance_actions[];