Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syncState()
- ~Scrolllock::
- syncState()
- return
- syncState()
- {
- if GetKeyState("ScrollLock" , "T")
- {
- SetDefaultKeyboard(0x0419)
- }
- else
- {
- SetDefaultKeyboard(0x0415)
- }
- }
- SetDefaultKeyboard(LocaleID){
- Static SPI_SETDEFAULTINPUTLANG := 0x005A, SPIF_SENDWININICHANGE := 2
- Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0)
- VarSetCapacity(binaryLocaleID, 4, 0)
- NumPut(LocaleID, binaryLocaleID)
- DllCall("SystemParametersInfo", "UInt", SPI_SETDEFAULTINPUTLANG, "UInt", 0, "UPtr", &binaryLocaleID, "UInt", SPIF_SENDWININICHANGE)
- WinGet, windows, List
- Loop % windows {
- PostMessage 0x50, 0, % Lan, , % "ahk_id " windows%A_Index%
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement