Unfortunately, I do not have Hebrew language support on my system. So I cannot verify its accessibility.
Try the following code:
Code:
InputBox, term, Locale Availability Verification, Enter the name of a language to verify availability.,, 300, 100,,,,, us
if ( ErrorLevel = 1 or term = "" )
ExitApp
result=
loop, HKEY_LOCAL_MACHINE, SYSTEM\CurrentControlSet\Control\Keyboard Layouts, 2, 1
{
RegRead, layout_file, HKEY_LOCAL_MACHINE, %a_LoopRegSubKey%\%a_LoopRegName%, Layout File
RegRead, layout_text, HKEY_LOCAL_MACHINE, %a_LoopRegSubKey%\%a_LoopRegName%, Layout Text
if ( InStr( layout_text, term, false ) )
{
result := result "`n" layout_text " (" a_LoopRegName ")"
if ( FileExist( SystemRoot "\system32\" layout_file ) )
result := result " is available."
else
result := result ", " layout_file " was not found."
}
}
MsgBox, The following results match your search term (%term%):`n%result%
return
Run the code as is and search for "us". You should observe several items in the results. The text in parenthesis is the language_id and device_id combination used for input to LoadKeyboardLayout.
You can also try loading Spanish language support:
Code:
SetFormat, Integer, hex
/*
language_id = 0409 ; English (United States)
device_id = 0000 ; US keyboard
device_id = 0001 ; United States-Dvorak keyboard
*/
/*
language_id = 0419 ; Russian
device_id = 0000 ; Russian keyboard
device_id = 0001 ; Typewriter keyboard
*/
language_id = 040a ; Spanish (Spain, Traditional Sort)
device_id = 0000 ; Spanish keyboard
KLF_ACTIVATE = 0x00000001
locale_id := DllCall( "LoadKeyboardLayout", "str", device_id language_id, "uint", 0, "uint" )
MsgBox, % "locale identifier = ". locale_id
return
Then test it with Notepad (or verify in Text Services and Input Languages"):
Code:
WinGet, hw_notepad, ID, Untitled - Notepad ahk_class Notepad
locale_en = 0x04090409 ; English (United States) with US keyboard layout
locale_en1 = 0xf0020409 ; English (United States) with Dvorak keyboard layout
locale_ru = 0x04190419 ; Russian with Russian keyboard layout
locale_ru1 = 0xf0080419 ; Russian with Typewriter keyboard layout
locale_es = 0x040a040a ; Spanish (Spain, Traditional Sort) with Spanish keyboard layout
WM_INPUTLANGCHANGEREQUEST = 0x0050
PostMessage, WM_INPUTLANGCHANGEREQUEST, 0, locale_es, Edit1, ahk_id %hw_notepad%
return
At the moment, I am juggling typing with English, Русски, and Español. Hopefully, this post will be in English.