diff --git a/docs/docs/behaviors/tap-dance.md b/docs/docs/behaviors/tap-dance.md new file mode 100644 index 00000000..9b5112d3 --- /dev/null +++ b/docs/docs/behaviors/tap-dance.md @@ -0,0 +1,56 @@ +--- +title: Tap Dance Behavior +sidebar_label: Tap Dance +--- + +## Summary + +A tap dance key outputs a keycode or behavior corresponding to how many times it is pressed. +Tap dances are completely custom, so for every unique tap dance key, a new tap dance must be defined in your keymap's +`behaviors`. + +### Configuration + +#### `tapping-term-ms` + +Defines how much time in milliseconds after the tap dance is pressed before a keybind is registered. + +#### `bindings` + +A list of one or more keybinds. This list can include [any keycode in ZMK](../codes/) and keybinds for ZMK behaviors. + +:::warning +Tap dances currently do not support hold-taps. +::: + +#### Example Usage + +This example configures a tap dance that outputs the number of keypresses from 1-5: + +``` +#include +#include + +/ { + behaviors { + td: tap_dance { + compatible = "zmk,behavior-tap-dance"; + label = "TAP_TEST"; + #binding-cells = <0>; + tapping_term_ms = <1000>; + bindings = <&kp N1>, <&kp N2>, <&kp N3>, <&kp N4> , <&kp N5>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &td + >; + }; + }; +}; + +``` \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 4ae23c59..57e77397 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -25,6 +25,7 @@ module.exports = { "behaviors/mod-morph", "behaviors/sticky-key", "behaviors/sticky-layer", + "behaviors/tap-dance", "behaviors/reset", "behaviors/bluetooth", "behaviors/outputs",