summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2022-06-13 22:12:55 +0200
committerGitHub <noreply@github.com>2022-06-13 22:12:55 +0200
commit1706da9054f8c4aa77493062a8937a7b64970a9e (patch)
tree1a77464586942c66bdcae99a26bf1558862a7842 /users
parentb17324498ee8e7bf1e8ed57cc8c9b505ca0ce85b (diff)
downloadqmk_firmware-1706da9054f8c4aa77493062a8937a7b64970a9e.tar.gz
qmk_firmware-1706da9054f8c4aa77493062a8937a7b64970a9e.zip
tap-dance: Restructure code and document in more detail (#16394)
Diffstat (limited to 'users')
-rw-r--r--users/edvorakjp/edvorakjp_tap_dance.c13
-rw-r--r--users/gourdo1/gourdo1.c2
-rw-r--r--users/mnil/config.h1
-rw-r--r--users/mnil/mnil.c4
-rw-r--r--users/ninjonas/config.h3
-rw-r--r--users/ninjonas/tap_dances.c16
6 files changed, 30 insertions, 9 deletions
diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c
index cee10de693..69fcbac1ca 100644
--- a/users/edvorakjp/edvorakjp_tap_dance.c
+++ b/users/edvorakjp/edvorakjp_tap_dance.c
@@ -64,6 +64,15 @@ void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) {
}
qk_tap_dance_action_t tap_dance_actions[] = {
- [TD_EDVORAKJP_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_lower_finished, td_lower_reset, 150),
- [TD_EDVORAKJP_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_raise_finished, td_raise_reset, 150),
+ [TD_EDVORAKJP_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_lower_finished, td_lower_reset),
+ [TD_EDVORAKJP_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_raise_finished, td_raise_reset),
};
+
+uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
+ return 150;
+ default:
+ return TAPPING_TERM;
+ }
+}
diff --git a/users/gourdo1/gourdo1.c b/users/gourdo1/gourdo1.c
index b964729be9..4e741ccc91 100644
--- a/users/gourdo1/gourdo1.c
+++ b/users/gourdo1/gourdo1.c
@@ -45,7 +45,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
[TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(dance_LSFT_each_tap, NULL, dance_LSFT_reset),
// Tap once for Escape, twice to reset to base layer
- [TD_ESC_BASELYR] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _BASE),
+ [TD_ESC_BASELYR] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _BASE),
};
#endif // TD_LSFT_CAPSLOCK_ENABLE
diff --git a/users/mnil/config.h b/users/mnil/config.h
index 3547785ff7..b471b9a818 100644
--- a/users/mnil/config.h
+++ b/users/mnil/config.h
@@ -19,3 +19,4 @@
#define MK_3_SPEED
#define MK_MOMENTARY_ACCEL
#define PERMISSIVE_HOLD
+#define TAPPING_TERM 250
diff --git a/users/mnil/mnil.c b/users/mnil/mnil.c
index d5bd0ef0bb..00da6086ef 100644
--- a/users/mnil/mnil.c
+++ b/users/mnil/mnil.c
@@ -140,7 +140,7 @@ void aa_reset(qk_tap_dance_state_t *state, void *user_data) {
// clang-format off
qk_tap_dance_action_t tap_dance_actions[] = {
- [AAE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ae_finished, ae_reset, 250),
- [OAA] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, aa_finished, aa_reset, 250)
+ [AAE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ae_finished, ae_reset),
+ [OAA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, aa_finished, aa_reset)
};
// clang-format on
diff --git a/users/ninjonas/config.h b/users/ninjonas/config.h
index 025dbb541a..565e40e841 100644
--- a/users/ninjonas/config.h
+++ b/users/ninjonas/config.h
@@ -2,6 +2,7 @@
#undef TAPPING_TERM
#define TAPPING_TERM 200
#endif
+#define TAPPING_TERM_PER_KEY
// Mouse Settings: Smoothing out mouse movement on keypress
#ifndef MOUSEKEY_INTERVAL
@@ -18,4 +19,4 @@
#undef COMBO_TERM
#define COMBO_COUNT 5
#define COMBO_TERM 60
-#endif \ No newline at end of file
+#endif
diff --git a/users/ninjonas/tap_dances.c b/users/ninjonas/tap_dances.c
index 63e4d3ba47..3e4cec9133 100644
--- a/users/ninjonas/tap_dances.c
+++ b/users/ninjonas/tap_dances.c
@@ -107,6 +107,16 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)),
// Advanced Tap Dances
- [TD_COPY_PASTE_APP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, copy_paste_app_finished, copy_paste_app_reset, 300),
- [TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, y_numpad_finished, y_numpad_reset, 300),
-}; \ No newline at end of file
+ [TD_COPY_PASTE_APP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, copy_paste_app_finished, copy_paste_app_reset),
+ [TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, y_numpad_finished, y_numpad_reset),
+};
+
+uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case TD(TD_COPY_PASTE_APP):
+ case TD(TD_Y_NUMPAD):
+ return 300;
+ default:
+ return TAPPING_TERM;
+ }
+}