summaryrefslogtreecommitdiffstats
path: root/docs/feature_tap_dance.md
diff options
context:
space:
mode:
authorJesse <me@jessearmstrong.com>2022-08-22 18:05:35 -0500
committerGitHub <noreply@github.com>2022-08-23 00:05:35 +0100
commit624d92e2f5fa3046aa5abc71f81ea84ecf3df489 (patch)
treeaab20b6035b116680b0086608f76b69cff683cea /docs/feature_tap_dance.md
parent68ad251667e97e946bc03744ec336148b984c06b (diff)
Update Tap Dance Example 4 (#18138)
break statements are missing from the switch for both registering and unregistering key codes. Neither have a default: case either. The code as exists in the repository right now does not compile. It does with this changes.
Diffstat (limited to 'docs/feature_tap_dance.md')
-rw-r--r--docs/feature_tap_dance.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md
index c055a9989a..368b35617a 100644
--- a/docs/feature_tap_dance.md
+++ b/docs/feature_tap_dance.md
@@ -305,7 +305,8 @@ void x_finished(qk_tap_dance_state_t *state, void *user_data) {
// Last case is for fast typing. Assuming your key is `f`:
// For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`.
// In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms.
- case TD_DOUBLE_SINGLE_TAP: tap_code(KC_X); register_code(KC_X);
+ case TD_DOUBLE_SINGLE_TAP: tap_code(KC_X); register_code(KC_X); break;
+ default: break;
}
}
@@ -314,8 +315,9 @@ void x_reset(qk_tap_dance_state_t *state, void *user_data) {
case TD_SINGLE_TAP: unregister_code(KC_X); break;
case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
case TD_DOUBLE_TAP: unregister_code(KC_ESC); break;
- case TD_DOUBLE_HOLD: unregister_code(KC_LALT);
- case TD_DOUBLE_SINGLE_TAP: unregister_code(KC_X);
+ case TD_DOUBLE_HOLD: unregister_code(KC_LALT); break;
+ case TD_DOUBLE_SINGLE_TAP: unregister_code(KC_X); break;
+ default: break;
}
xtap_state.state = TD_NONE;
}