Created
August 14, 2020 10:27
-
-
Save dnnsmnstrr/0591fd7d64eda2fc63d99e6f488a435a to your computer and use it in GitHub Desktop.
Enable umlaut replacement, with the option to revoke the replacement using backspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
hscancel=backspace | |
hstime=1000 | |
hsfrom = | |
hsto = | |
; UMLAUTE | |
:*?C:ae:: | |
replace("ae","ä") | |
return | |
:*?C:Ae:: | |
replace("Ae","Ä") | |
return | |
:*?C:oe:: | |
replace("oe","ö") | |
return | |
:*?C:Oe:: | |
replace("Oe","Ö") | |
return | |
:*?C:ue:: | |
replace("ue","ü") | |
return | |
:*?C:Ue:: | |
replace("Ue","Ü") | |
return | |
:*?C:Ss:: | |
replace("Ss","ß") | |
return | |
; REPLACE | |
replace(from,to) | |
{ | |
global hsfrom, hsto, hscancel, hstime | |
hsfrom = %from% | |
hsto = %to% | |
send %hsto% | |
hotkey, $%hscancel%, hscancel | |
hotkey, $%hscancel%, on | |
settimer, hsdisablecancel, -%hstime% | |
} | |
hscancel: | |
hslen := strlen(hsto) | |
send {bs %hslen%}%hsfrom% | |
; fall through | |
hsdisablecancel: | |
hotkey, %hscancel%, off | |
return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment