微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

而 GetKeyState 无缘无故地发送 ESC

如何解决而 GetKeyState 无缘无故地发送 ESC

我在松开按钮后做了一个函数 (f4) 该函数发送 ESC 2 次 我用 } 关闭函数后写了 Send {esc} 来反击它 我仍然可以看到它发生并且它触发了我。 有解决办法吗?

~^f4::
DllCall("mouse_event","UInt",0x01,950)
Sleep,100
Send {x}
Sleep,100
while GetKeyState("f4")
{
Sleep,100
Send {r}
Sleep,100
Send {enter}
Sleep,30
Send {esc}
Sleep,100
DllCall("mouse_event",-950)
Sleep,100
Send {e}
Sleep,100
Send {Left}
Sleep,5
Send {Left}
Sleep,50
Send {enter}
Sleep,10
Send {esc}
Sleep,950)
}
Send {esc}
return

解决方法

基于我理解的解决方案:

~^f4::
DllCall("mouse_event","UInt",0x01,950)
Sleep,100
Send {x}
Sleep,100
while GetKeyState("f4")
{
Sleep,100
Send {r}
Sleep,100
Send {enter}
Sleep,30
if !GetKeyState("f4")
    break
Send {esc}
Sleep,100
DllCall("mouse_event",-950)
Sleep,100
Send {e}
Sleep,100
Send {Left}
Sleep,5
Send {Left}
Sleep,50
Send {enter}
Sleep,10
if !GetKeyState("f4")
    break
Send {esc}
Sleep,950)
}
Send {esc}
return

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。