回复 2# xms77
感谢您的回复,论坛搜索了下找到了另一种解决方法,简单修改了一下你的例子,附上代码:#include <Misc.au3>
HotKeySet("{ESC}", "_exit")
Global $lastIsRight = False
Global $lastTime
While 1
If _IsPressed("11") = True Then chuangkou()
WEnd
Func chuangkou()
While _IsPressed("11")
Sleep(50)
WEnd
$nowTime = DllCall("kernel32.dll", "int", "GetTickCount")
If $lastIsRight = False Then
$lastTime = DllCall("kernel32.dll", "int", "GetTickCount");
$lastIsRight = True;
Else
Local $nowTime = DllCall("kernel32.dll", "int", "GetTickCount")
If ($nowTime[0] - $lastTime[0]) < 550 Then
$lastIsRight = False;
Else
$lastTime[0] = $nowTime[0];
EndIf
EndIf
If $lastIsRight = False Then MsgBox(0, 0, "按了2次CTRL")
EndFunc ;==>chuangkou
Func _exit()
Exit
EndFunc ;==>_exit
|