Skip to content

Instantly share code, notes, and snippets.

@Robert-Beier
Last active August 2, 2023 09:45
Show Gist options
  • Save Robert-Beier/cbb623a600d7abfc8ceb4c36d2ae9395 to your computer and use it in GitHub Desktop.
Save Robert-Beier/cbb623a600d7abfc8ceb4c36d2ae9395 to your computer and use it in GitHub Desktop.
(outdated) Script for AutoHotkey to write german umlaute(ä, ö, ü) and eszett (ß) on US Keyboard on Windows like on MacOS
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #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.
!u::Return ; umlaut
!s::SendInput % "ß"
*u::umlaut("u","ü","Ü")
*a::umlaut("a","ä","Ä")
*o::umlaut("o","ö","Ö")
umlaut(regular,umlautOption,umlautShiftOption) {
if (A_PriorHotKey = "!u" && A_TimeSincePriorHotkey < 2000) {
if (GetKeyState("Shift")) {
SendInput % umlautShiftOption
} else {
SendInput % umlautOption
}
} else {
if (GetKeyState("Shift") or GetKeyState("Capslock","T")) {
SendInput % "+" regular
} else {
SendInput % regular
}
}
}
^u::Send ^u
^!u::Send ^!u
^#u::Send ^#u
^+u::Send ^+u
!#u::Send !#u
!+u::Send !+u
#u::Send #u
#+u::Send #+u
^a::Send ^a
^!a::Send ^!a
^#a::Send ^#a
^+a::Send ^+a
!a::Send !a
!#a::Send !#a
!+a::Send !+a
#a::Send #a
#+a::Send #+a
^o::Send ^o
^!o::Send ^!o
^#o::Send ^#o
^+o::Send ^+o
!o::Send !o
!#o::Send !#o
!+o::Send !+o
#o::Send #o
#+o::Send #+o
@Robert-Beier
Copy link
Author

I just published a cleaner version of the script here: https://gist.github.com/Robert-Beier/7b7b0a152fcb17bfcebc8bb12e142638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment