Double click for CapsLock?

void tapDanceAction(uint8_t tapDanceIndex, byte row, byte col, 
                    uint8_t tapCount, 
                    kaleidoscope::TapDance::ActionType tapDanceAction) {

  switch (tapDanceIndex) {
  case SHIFT_CAPS: 
    {
      static bool isCapsOn;

      if (tapDanceAction == kaleidoscope::TapDance::Release) {
        Macros.play(MACRO(T(CapsLock)));

        if (isCapsOn) {
          isCapsOn = false;
          return;
        }
        isCapsOn = true;
      }

      return tapDanceActionKeys(tapCount, tapDanceAction,
                                Key_LeftShift, Key_CapsLock);
    }
  }
}

When you press this once and hold it, it will act as a LeftShift. Tap it twice, and it will become CapsLock. To make it possible to turn Caps Lock off with a single tap, we remember if it turned on, and regardless of tapCount, turn it off if it was on.

Mind you, this is untested, you may have to adjust it a little.

1 Like