Doubletap to subsume normal tap?`

A previous forum post here which I quite liked suggested mapping the “`~” key as follows: tap → escape, long press → backtick, shifted → tilde. So I have

ifShift final holdKey S-graveAccentAndTilde
ifTap final tapKey escape
holdKey graveAccentAndTilde

working great (now I’m fussing with holdTimeout and doubletapTimeout).

What would really make this sweet is if I could also have doubletap → three-backticks. For markdown code blocks, of course.

Can’t figure out how to do it, especially since I’ve mapped a single tap to escape not backtick.

Should I be able to do this with ifGesture timeoutIn or ifInterrupted or something else???

(Problem of course is that if single tap goes to escape then double tap would go to escape backtick backtick backtick - I need to not have that first escape be emitted if doubletap.)

(I suppose I can make it work with tap → backtick and hold → escape, but really I hit escape a lot (emacs user here, among other things)).

Well, if you don’t want that escape tap, then you will have to use ifGesture, which of course introduces a delay, which I think is going to be quite annoying on escape key…

Still, I guess this should work:

ifShift final holdKey S-graveAccentAndTilde
ifHold graveAccentAndTilde
ifGesture $thisKeyId tapKeySeq ` `
holdKey graveAccentAndTilde
1 Like

Didn’t work. Tried various combinations of ifGesture. However! I decided to switch to the following map:

  • tap → backtick
  • doubletap → backtick backtick backtick <= start/end of code block in markdown
  • long-press → escape
  • shift-tap → tilde

And it works just fine and I like the result. So I’m happy. TY!

1 Like

Check out this older post from me explaining how to detect different kinds of invocations on a single key.

1 Like