# TapDance and space/period switching

**URL:** <https://community.keyboard.io/t/tapdance-and-space-period-switching/621>\
**Category:** Plugins\
**Created:** [October 31, 2017, 12:12am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621 "2017-10-31T00:12:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [October 31, 2017, 12:12am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/1 "2017-10-31T00:12:10Z")

</div>

I would like hitting space twice to insert a period and then a space. I tried using tap dance just to get it to insert a period if I hit it twice, but when I put in the code I get no more space and no period. Does anyone know what is going on here?

```
void tapDanceAction(uint8_t tap_dance_index, uint8_t tap_count,
                kaleidoscope::TapDance::ActionType tap_dance_action) {
  switch (tap_dance_index) {
  case SPACE_PERIOD:
    return tapDanceActionKeys(tap_count, tap_dance_action,
                          Key_Spacebar, Key_Period);
  }
}

```

I have my space set to `TD(SPACE_PERIOD)`. It is defined as an enum, and I have `&TapDance` as the last argument to my `use` function.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 31, 2017, 12:21am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/2 "2017-10-31T00:21:49Z")

</div>

At a first glance, I see nothing wrong with your code. Will try to have a look at it after I got some sleep, try it as-is (my own tapdance keys function properly, so here’s hoping that the plugin is not fundamentally broken).

Meanwhile, I’d have one question: is `SPACE_PERIOD` specified as `enum { SPACE_PERIOD };` or as `enum { SPACE_PERIOD = KALEIDOSCOPE_SAFE_START };`? (It should be the former)

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [October 31, 2017, 12:22am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/3 "2017-10-31T00:22:54Z")

</div>

```
enum { MACRO_VERSION_INFO,
   MACRO_ANY,
   MACRO_PIPE,
   SPACE_PERIOD
 };

```

This is an enum I have in my sketch. When I sit down and figure out how to compile from the command line I’m going to put up a repo on github. One thing at a time.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 31, 2017, 12:25am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/4 "2017-10-31T00:25:08Z")

</div>

That _should_ work. Will try to have a look at this issue tomorrow. It’s probably something very simple.

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [October 31, 2017, 12:26am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/5 "2017-10-31T00:26:38Z")

</div>

I worked on it for a bit the other day and gave up. I seem to always do this work late and then never get anything working.

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [October 31, 2017, 1:34am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/6 "2017-10-31T01:34:53Z")

</div>

@algernon, I added my firmware to github, but I removed the `use` of TapDance so that it runs, but the rest of the code is there. It is very vanilla. I hope this helps.

---

<div class="post-metadata">

**Author:** ![arley](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/arley/32/56_2.png) [@arley](https://community.keyboard.io/u/arley)\
**Post date:** [October 31, 2017, 2:22am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/7 "2017-10-31T02:22:48Z")

</div>

Such a cool idea, I’m totally going to rip this off 🙂

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [October 31, 2017, 2:44am UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/8 "2017-10-31T02:44:53Z")

</div>

I found myself typing the space twice and just expecting it to work. The only place I think my brain might have picked this up is on the iPhone.

---

<div class="post-metadata">

**Author:** ![Jennigma](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jennigma/32/353_2.png) [@Jennigma](https://community.keyboard.io/u/Jennigma)\
**Post date:** [October 31, 2017, 1:56pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/11 "2017-10-31T13:56:55Z")

</div>

I do this too, and it hasbeen on my fixit list. 🙂 thanks for getting there first!

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 2, 2017, 2:23pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/12 "2017-11-02T14:23:14Z")

</div>

@algernon, I don’t want to bug you too much. Were you able to reproduce the issue?

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 2, 2017, 3:36pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/13 "2017-11-02T15:36:09Z")

</div>

I just tried doing the same as above and it worked fine for me…

> **[jamesnvc / KeyboardioLayout - 9bb8446](https://bitbucket.org/jamesnvc/keyboardiolayout/commits/9bb844625c0807ebfe982c43ea4fb152bd50943c?at=tapdance-space-tests)**
>
> Testing tapdances space/period

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 2, 2017, 4:12pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/14 "2017-11-02T16:12:28Z")

</div>

shoot that wasn’t my fork

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 2, 2017, 4:14pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/15 "2017-11-02T16:14:16Z")

</div>

This is my attempt, and I still don’t know what I’m missing. [https://github.com/adkron/Model01-Firmware/tree/space\_period](https://github.com/adkron/Model01-Firmware/tree/space_period)

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 2, 2017, 4:39pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/16 "2017-11-02T16:39:24Z")

</div>

It looks like you haven’t put the tapdance action on a key - you’ll need to have a key in your map like `TD(SPACE_PERIOD)` (presumably replacing the `Key_Spacebar` you currently have).

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 2, 2017, 4:49pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/17 "2017-11-02T16:49:56Z")

</div>

I had that I backed it out. I forgot to push when I made the branch. I’m apparently too spacey to be much help. I’d like to blame learning a new keyboard, but I’m starting to get a little better with it so that isn’t the issue.

I updated the branch, but still nothing.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 2, 2017, 5:09pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/18 "2017-11-02T17:09:47Z")

</div>

The only difference I see is that I used separate enums for macros and tap-dance actions, while you have one…I’m not sure if that makes a difference, but maybe give that a try?

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 2, 2017, 5:17pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/19 "2017-11-02T17:17:10Z")

</div>

Thanks, @james.nvc, but it didn’t work. I didn’t think it would make a difference, but I was hopeful.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 2, 2017, 5:20pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/20 "2017-11-02T17:20:52Z")

</div>

Oh! I think I see the problem! You’ve defined your method to handle tapdance methods like

```auto
void tapDanceAction(uint8_t tap_dance_index, uint8_t tap_count,
kaleidoscope::TapDance::ActionType tap_dance_action) {

```

but it should be

```auto
void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count,
                    kaleidoscope::TapDance::ActionType tap_dance_action) {

```

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 2, 2017, 5:22pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/21 "2017-11-02T17:22:42Z")

</div>

It looks like the documentation has the wrong thing, I’ll submit a PR to address that.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [November 2, 2017, 5:23pm UTC](https://community.keyboard.io/t/tapdance-and-space-period-switching/621/22 "2017-11-02T17:23:47Z")

</div>

Oh dear. That will be it. So sorry! And thanks @james.nvc for figuring out the issue!

[Next page](https://community.keyboard.io/t/tapdance-and-space-period-switching/621.md?page=2)
