Skip to content

Instantly share code, notes, and snippets.

@Robert-Beier
Last active August 2, 2023 09:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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

Robert-Beier commented Sep 5, 2019

AltGr + u, a -> ä
AltGr + u, u -> ü
AltGr + u, o -> ö
AltGr + u, Shift + a -> Ä
...
AltGr + s -> ß

@mbinna
Copy link

mbinna commented Jul 19, 2022

Awesome, thank you! 🥳

@JulianWagn3r
Copy link

Can you make it like this?

AltGr + a -> ä
AltGr + u -> ü
AltGr + o -> ö
AltGr + Shift + a -> Ä
...
AltGr + s -> ß

Would be wonderful! :)

@Robert-Beier
Copy link
Author

@JulianWagn3r I'm taking some time off right now and don't have the time to do that currently, sorry.

@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