TapDance and space/period switching

Yeah, I copied the docs. I guess I should have been digging through code. Any good suggestions on trouble shooting techniques?

1 Like

It works, and is in my master config now. Thanks!

2 Likes

Thanks! bookmarking to add to mine. :slight_smile:

Now that I finally have this working I’ve convinced my fingers to use the normal period key. Retraining the brain is hard.

2 Likes

https://github.com/adkron/Model01-Firmware/ this is what I have so far with the tap dance space to period.

  • change period to shifted period to help train my self
  • 2x on space adds a period
  • 3x on space adds a period followed by a space

The last one took a macro to make this work.I consider this a bug in tap dance. If I don’t have the macro in the three tap slot, then I get a period with no space when I tap three times. I think that tap dance is swallowing the last click and picking the highest tap dance selection.

Is my understanding correct that by “without a macro” you meant tapDanceActionKeys(tap_count, tap_dance_action, Key_Spacebar, Key_Period, Key_Period, Key_Spacebar)?

Because if you did, that’s no bug. That’s what tapDanceActionKeys is supposed to do: it takes the tap_count-th element from the list you specified. So on the third tap, it would take the second Key_Period.

To do this without a macro, you could just send the key sequence “by hand”. You’re not required to use tapDanceActionKeys. There are a few examples of such use in my sketch. In this case, however, a macro appears to be the cleanest solution.

On the other hand, I think we would be able to come up with a variant of tapDanceActionKeys that supports inlining macros. Perhaps with a bit of template magic… but that would be little gain for a whole lot of trouble. I’d just stick with the macro.

Mind you, TapDance does pick the last one in the list, so if you have two keys in the list, and tap three times, it will pick the second, as if you tapped only twice.

No, I mean tapDanceActionKeys(tap_count, tap_dance_action, Key_Spacebar, Key_Period)> If I have this and I hit the key three times I only get a space. Right now I have a third with a macro that does . to make up for the lost key press.

I see. That does sound like a bug. It should’ve input a single period. (Not that would help you much, since you want both, not one of them.)

Yes, with three clicks I wanted a period and space, but I only got a period. That is why I used the macro to w workaround. It works fine for me, but I thought this could catch others later.

Ah! I misunderstood then. In that case, the tapDanceActionKeys function works as it should: it either takes the entry that corresponds to the tap count, or the last one specified. It does not wrap around, nor does it support multiple keys per tap (only via macros, as you found). I think this is reasonable behaviour in this case.

However, I’m very interested in any ideas how we could make TapDance easier to use, and easier to understand. Any suggestions towards that goal are more than welcome! If that involves changing my mind, it wouldn’t be the first time.

The behavior I expected was that once we got to the last tap possible that it would just pick the last key and any further taps would be like hitting a new key.

For this example tapDanceActionKeys(tap_count, tap_dance_action, Key_Spacebar, Key_Period)

I expect if I press I would get:

<space><space>[period]<space>[space]

<> are presses and [] are outputs. I hope that clears it up.

1 Like

Mhm. I think I know how to get the behaviour you descibe. I can teach tapDanceActionKeys to explicitly re-start the tap dance when reaching max_keys.

Can you open a GitHub issue about this on Kaleidoscope-TapDance? I gotta run, and I fear I’ll forget doing so myself. Thanks! :slight_smile:

I created the issue and linked it back to here.

1 Like