[feature] alt+tab 切换窗口后将鼠标移动至窗口中心

This commit is contained in:
Klesh Wong 2021-01-23 20:51:24 +08:00
parent b0e1a73432
commit de1a130495

View File

@ -138,7 +138,15 @@ MoveCursorWin(toRight) {
~#7 Up:: ~#7 Up::
~#8 Up:: ~#8 Up::
~#9 Up:: ~#9 Up::
Sleep 0.5 Sleep 100
WinGetPos, x, y, w, h, A
DllCall("SetCursorPos", "int", x + w / 2, "int", y + h / 2)
return
~!Tab Up::
while (GetKeyState("Alt") != 0 or GetKeyState("Tab") != 0) {
Sleep 50
}
Sleep 100
WinGetPos, x, y, w, h, A WinGetPos, x, y, w, h, A
DllCall("SetCursorPos", "int", x + w / 2, "int", y + h / 2) DllCall("SetCursorPos", "int", x + w / 2, "int", y + h / 2)
return return