【发布时间】:2018-02-06 14:48:58
【问题描述】:
我使用这个脚本来跟踪 Win 7 上的键盘布局,它工作正常:
getactiveKL() {
active_hwnd := WinExist("A")
threadID := dllCall("GetWindowThreadProcessId", "uint", active_hwnd)
code := dllCall("GetKeyboardLayout", "uint", threadID, "uint") & 0xFFFF
return code
}
; 1049 - RU (hex: 419)
; 1033 - EN (hex: 409)
loop {
sleep, 600
KL := getactiveKL()
tooltip, %KL%
}
但它在 win 10 上不起作用。也就是说,它只能工作一次 - 如果我将布局设置为 RU,然后运行此脚本,它会正确检测到,但是当我切换布局时 - 没有任何变化。
你知道如何让它在 Windows 10 上运行吗?
【问题讨论】:
标签: autohotkey keyboard-layout