Code: Select all
; https://docs.microsoft.com/de-de/windows/desktop/Intl/language-identifier-constants-and-strings
F7:: SetDefaultKeyboardLang(0x02809) ; english
F8:: SetDefaultKeyboardLang(0x0407) ; german
F9:: SetDefaultKeyboardLang(0x040D) ; hebrew
; https://autohotkey.com/boards/viewtopic.php?f=6&t=18519
SetDefaultKeyboardLang(LocaleID){
Static SPI_SETDEFAULTINPUTLANG := 0x005A, SPIF_SENDWININICHANGE := 2
Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0)
VarSetCapacity(binaryLocaleID, 4, 0)
NumPut(LocaleID, binaryLocaleID)