按键精灵启动热键,如何设置为按下Q开始脚本运行,松开Q结束脚本运行

知道的麻烦说下。。。不要给我说别的乱七八糟的,我问的就是这个。。。


源码如下,个人原创,先启动脚本,然后才能按Q启动你要执行的代码。


Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As any) As Integer

Do

Key = WaitKey()

If key = 81 Then 

Exit do

End If

Loop

TracePrint "你按下q已经启动脚本"

BeginThread 执行脚本

BeginThread 判断

Sub 判断

Do

If GetAsyncKeyState(81) = 0 Then 

TracePrint "你松开q已经关闭脚本"

exitScript

End if

Loop

End Sub


Sub 执行脚本

TracePrint  "执行成功"

End Sub

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-01-16
做成小精灵可以.自启动或者用脚本载入事件子程序.
第2个回答  2014-01-16
无法做到。但是有其他办法