本帖最后由 cyl675 于 2013-10-22 14:52 编辑
#include <Misc.au3>
#include <ScreenCapture.au3>
$dll = DllOpen("user32.dll")
$flag = False;左右键全按下开关
While 1
Sleep(10)
If _IsPressed("01", $dll) Then
If _IsPressed("02", $dll) Then
Local $aPos = MouseGetPos()
$flag = True;当左右键全按下去时开关打开
;MsgBox(4096, "左右键全按时坐标 X,Y:", $aPos[0] & "," & $aPos[1])
EndIf
EndIf
If $flag Then
Sleep(10)
If Not _IsPressed("01", $dll) Then
If Not _IsPressed("02", $dll) Then
Local $aPos = MouseGetPos()
$flag = False;当左右键全松开时开关关闭
MsgBox(4096, "左右键全松开时坐标 X,Y:", $aPos[0] & "," & $aPos[1])
EndIf
EndIf
EndIf
WEnd
DllClose($dll)
用IsPressed效率太低,你的代码要先按左键然后按下右键,松开时是先松开左键然后右键,先松开右键然后左键不行 |