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:
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
In addition, can I replace the hardcoded key by the original keycode?
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.
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.