如何在 Windows 7 中使用自动热键发送键盘布局切换事件?

Voi*_*oid 5 windows windows-7 autohotkey

我想将键盘布局/语言切换重新映射到Win+ Space,我尝试了:

LWin & Space::发送,^+

但它似乎不起作用,我希望它发送一个Ctrl+Shift序列,以便我可以使用Win+在键盘布局之间切换Space

我怎样才能使这项工作?

小智 8

Win+Space 开关在我的 win7-x64 上工作正常:

; This should be replaced by whatever your native language is. See 
; http://msdn.microsoft.com/en-us/library/dd318693%28v=vs.85%29.aspx
; for the language identifiers list.
ru := DllCall("LoadKeyboardLayout", "Str", "00000419", "Int", 1)
en := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)

#Space::
w := DllCall("GetForegroundWindow")
pid := DllCall("GetWindowThreadProcessId", "UInt", w, "Ptr", 0)
l := DllCall("GetKeyboardLayout", "UInt", pid)
if (l = en) 
{
    PostMessage 0x50, 0, %ru%,, A
}
else
{
PostMessage 0x50, 0, %en%,, A
}
Run Code Online (Sandbox Code Playgroud)

更多详情:http : //www.autohotkey.com/board/topic/70019-keyboard-layout-switcher-for-many-layouts/


Rob*_*ink 1

你确定这是Ctrl+ Shift?在我的系统上它是Alt+ Shift。无论如何,使用这个命令:

LWin & Space::Send, {Alt Down}{Shift}{Alt up}
Run Code Online (Sandbox Code Playgroud)

如果您的系统确实使用Ctrl+Shift组合,请将 Alt 替换为 Ctrl。