# Needed: TapDance Example

**URL:** <https://community.keyboard.io/t/needed-tapdance-example/6682>\
**Category:** Programming\
**Created:** [April 15, 2024, 12:05am UTC](https://community.keyboard.io/t/needed-tapdance-example/6682 "2024-04-15T00:05:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Bruce](https://community.keyboard.io/u/Bruce)\
**Post date:** [April 15, 2024, 12:05am UTC](https://community.keyboard.io/t/needed-tapdance-example/6682/1 "2024-04-15T00:05:19Z")

</div>

Can anyone post an example of Tapdance with not only tap, but one or more of hold, doubletap, and tap & hold?

I am aware of the kaleidescope documentation and example, but I would appreciate a concrete example, even a simple one. I have managed to write tapdance in QMK for another keyboard, but Kaleidescope is just different enough that I’m struggling.

---

<div class="post-metadata">

**Author:** ![rnp](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/rnp/32/881_2.png) [@rnp](https://community.keyboard.io/u/rnp)\
**Post date:** [April 17, 2024, 8:00pm UTC](https://community.keyboard.io/t/needed-tapdance-example/6682/2 "2024-04-17T20:00:17Z")

</div>

This TapDance action does single/double/triple tap to insert paren→bracket→brace.

```C
enum {
    TDLBR, // left paren → bracket → brace
    TDRBR // right paren → bracket → brace
};

void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count,
                    kaleidoscope::plugin::TapDance::ActionType tap_dance_action)
{
    switch (tap_dance_index)
    {
        case TDLBR:
            return tapDanceActionKeys(tap_count, tap_dance_action,
                                      TOPSY(9), Key_LeftBracket, Key_LeftCurlyBracket);
            break;
        case TDRBR:
            return tapDanceActionKeys(tap_count, tap_dance_action,
                                      TOPSY(0), Key_RightBracket, Key_RightCurlyBracket);
            break;
    }
}

```

---

<div class="post-metadata">

**Author:** ![Bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Bruce](https://community.keyboard.io/u/Bruce)\
**Post date:** [April 19, 2024, 1:27am UTC](https://community.keyboard.io/t/needed-tapdance-example/6682/3 "2024-04-19T01:27:12Z")

</div>

Thanks! I think I can take it from here.
