我正在尝试实现该算法,并重写 Windows 输入改变逻辑:
我试过这个
LAlt::
While GetKeyState("LAlt", "P") {
Input, key, L1, % "{LControl}{RControl}{LWin}{RWin}{AppsKey}{LShift}{RShift}"
. "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}"
. "{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}"
. "{Del}{Ins}{BS}{CapsLock}{NumLock}{PrintScreen}{Pause}{Tab}"
(key = "") && key := "{" StrReplace(ErrorLevel, "EndKey:") "}"
if (key != "{LShift}") {
Send {LAlt Down}%key%
Continue
}
KeyWait, LShift
if (A_PriorKey != "LShift") {
Send, {LAlt Down}{LShift Down}%A_PriorKey%
Continue
}
else MsgBox, YEAH
}
return
但它效果不太好,有些怪异。首先,即使我把它从键盘上松开,它还是Send
会锁定Alt。最后,按键失效了,我不得不按两次。
我怎样才能以更强大的方式编写它?