Hello Keyboard Maestro Community,
I like to type in chords and designed a custom keyboard layout. To type chords more consistently, I created a duplicate key thats value is the last key pressed. This lets me type words like 'good' or 'pressed' without double tapping(which i reserve for capitalization). I did this on Windows using Auto Hot Keys and they had a variable called A_PriorKey, which is 'The name of the last key which was pressed prior to the most recent key-press or key-release'. So what I did was use a '&' as my duplicate key, so whenever I typed a word containing 's&' it would produce 'ss' like in 'pressed'. This is what the code looks like.
; preceding key
&::
key := A_PriorKey
Send {%key%}
Return
I searched for a prior key, duplicate and repeat key but found nothing useful. I made a quick hack with the following script
.It does not work every time though which is frustrating. 20 times: pres& pres& press press pres& press press press press pres& press pres& press press press pres& pres& press press press
7/20 times resulted in the wrong text. I think it used to be better... maybe an update happened or my mac is getting worse idk.
If there is a better way to get this accomplished, please let me know. Thank you!