TapDance and space/period switching

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.

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)

1 Like
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.

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

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.

@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.

1 Like

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

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.

3 Likes

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

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

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

shoot that wasn’t my fork

This is my attempt, and I still don’t know what I’m missing. https://github.com/adkron/Model01-Firmware/tree/space_period

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).

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.

1 Like

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?

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

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

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

but it should be

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

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

2 Likes

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

2 Likes