As generating umlauts with uhk config alone is finicky at best, I’m back to generating them via rightAlt+key combos. For example, say RA+;. How to map this combo onto mod layer, so mod+; generates RA+; while allowing to be shifted as well?
Tried following macro for a key on mod layer, but getting stuck on the shifted version:
pressKey rightAlt
ifShift suppressMods tapKeySeq S-semicolonAndColon <--- can't get this bit to work
else tapKey semicolonAndColon
releaseKey rightAlt
Guess because of suppressMods RA needs to be sent as well, but RA-S-apostropheAndQuote is not a valid keyseq.
Any pointers?
Your example still has the same issue in that shifted version does not work, as in it’ll simply produce a colon character.
On OS level the mapping is done by xmodmap, that converts (LS)RA-semicolonAndColon into umlauts:
! Set Right Alt as a Mode Switcher
keycode 108 = Mode_switch
keycode 47 = semicolon colon odiaeresis Odiaeresis
xev reports keycode 47 for semicolonAndColon key. showkey command shows keycode 39. showkey --scancodes shows 0x27 0xa7, guess one scancode for press and other for release?
Well, I have retested a similar-ish scenario, and it works fine for me. (I have my linux configured via xkb to write things like čČ via right alt, and that works fine when mapping holdKey RA-c in my fn layer. Binding via gui directly works fine too with both.)
I am not sure what is wrong, but it probably has to do with timing. You can try setting keystrokeDelay to some human-relevant value via $onInit. (Place set keystrokeDelay 200 command into a macro named $onInit, then see if that works. Then debug with showkey. )
Set the dealy on $onInit and it started working. Then I removed the delay again and it continued working. Beats me, but it works – both macro and simple keypress config. Thanks!