按键精灵 如何实现按住某个键的时候执行无限执行一个循环 松开这个键循环就终止呢

2025-05-14 12:04:06
推荐回答(1个)
回答1:

Dim LastX, LastY, x, y, ex, ey
Rem key
Key=WaitKey()
While Key = 16
GetCursorPos LastX,LastY
Delay 30
GetCursorPos x,y
ex = x - LastX
ey = y - LastY
If ey>0
KeyPress 73,1
Delay 10
ElseIf ey < 0
KeyPress 75,1
Delay 10
EndIf
LastX = x : LastY = y
MoveTo 700, 500
Goto key
EndWhile