Macro: doubleTap to create capital German Umlauts (on a de_ch layout)

Hi!

When using a Swiss German keyboard map, German Umlauts are a particular pain if you want to have them upper case. You need to hit caps lock, then the umlaut, then caps lock again, of course. Pressing only shift results in an é instead of Ö. On Windows, I wrote a tiny Autohotkey line that helps me here: double tapping the ö capitalizes it. I thought UHK would be able to do this for me, too, with a little macro. Actually, I’d like to have one macro for öäü, but I started off with one for the ö. That’s my attempt:

ifDoubletap {
    suppressMods tapKey capsLock
    tapKey ;
    suppressMods tapKey capsLock
}
ifNotDoubletap tapKey ;

The ö key is right next to the l.

Well, it doesn’t work as expected, and I don’t see why. In the docs it says, ifDoubletap and ifNotDoubleTap always come in pairs, so I would expect the last line only to be executed if it’s a single tap. However, it produces öÖ when I doulbe tap, so the lower case ö gets typed even before the upper case Ö.

I guess there is something fundamentally wrong here. Any idea is highly appreciated :slight_smile:

In addition, can I replace the hardcoded key by the original keycode?

Cheers

André

In this case you need the time machine, specifically the ifGesture command. Search firmware/doc-dev/user-guide.md at master · UltimateHackingKeyboard/firmware · GitHub for it :wink:

Sorry, not easily, although better support is planned. At the moment there is this command that can be used to do some amount of magic:

COMMAND = activateKeyPostponed [atLayer LAYERID] [append | prepend]  KEYID

@abonhote You may want to take a look at How many single key modifier/combination possible? - #6 by maexxx

I described there how to put various functions on a single key, depending on how long/often you press it.

The problem with ifDoubleTap is that on the first tap, it will always activate the primary (non-doubletap) function, and on the second tap, it will then activate the doubletap function.

If you want to skip any activation on the first tap (if followed by another tap within a timeout period), then you have to use ifGesture. This will introduce a timeout delay if you only tap it once.

Try this:

ifGesture timeoutIn 300 $thisKeyId final tapKeySeq capsLock semiColonAndColon capsLock
tapKey semiColonAndColon

You may need to set the keystroke interval to more than 0 in the Typing behaviour in Agent (I use 10), just so that the UHK produces a little delay between the scancodes in the tapKeySeq. Some host OS need this; some don’t.

3 Likes

Thanks Karel, I think this is too much for me at the moment :wink: I’ll stick to @maexxx’ solution :smiley:

Hey @maexxx , this is awesome. Exactly what I need! Thanks a ton!

Welcome!

1 Like