我有一个英语键盘设置为德语。因此,我使用的不是qwerty,而是qwertz。当我把键盘切换回英语时,我想要默认的英语键盘,除了字母y和z,因为我非常习惯用德语输入这些字符,所以当我更改布局时,总是会把它们搞混。所以我在找这样的剧本:
If keypress is third row, 7th key:
Change output to z
If keypress is fifth row, 2nd key:
Change output to y另一种选择是以英语布局为条件进行更改:
If keyboard-layout is english:
if keypress is y:
Change output to z
if keypress is z:
Change output to y 发布于 2021-11-03 08:11:16
试试这个:
#If (GetKeyboardLanguage(WinActive("A")) = 0x0409) ; english (german = 0x0407)
z::y
y::z
#If
GetKeyboardLanguage(_hWnd=0){
if !_hWnd
ThreadId=0
else
if !ThreadId := DllCall("user32.dll\GetWindowThreadProcessId", "Ptr", _hWnd, "UInt", 0, "UInt")
return false
if !KBLayout := DllCall("user32.dll\GetKeyboardLayout", "UInt", ThreadId, "UInt")
return false
return KBLayout & 0xFFFF
}https://www.autohotkey.com/board/topic/116538-detect-which-language-is-currently-on/#entry672236
https://stackoverflow.com/questions/69820887
复制相似问题