您的位置:首页 > 其它

au3 实现响应双击鼠标左键实现

2017-05-27 08:32 531 查看
要点:

       1.通过计时器计算两次点击的时间判断是否是双击

实例代码;

      

Local $hTimer = TimerInit()

$DBDown= 0

  While 1

        Switch GUIGetMsg()

            Case $GUI_EVENT_CLOSE

                ExitLoop
Case $GUI_EVENT_PRIMARYDOWN   ;计时器校验是否是双击
$fDiff = TimerDiff($hTimer)
If $DBDown = 0 Or $fDiff > 500 Then
  $DBDown = 1
  $hTimer = TimerInit() ; Begin the timer and store the handle in a variable.
Else
  If $fDiff < 500 Then
 $DBDown = 2
  Else
 $DBDown = 0
  EndIf
  EndIf
Case $GUI_EVENT_PRIMARYUP
If $DBDown = 2 Then
  $DBDown = 0
 Local $aArray = GUIGetCursorInfo($hDesk)
 If @error = 0 Then  ;事件
Switch   $aArray[4]
 Case $picBuff[1]
 MessageBox(0,0, "HELLO")

 EndSwitch
  EndIf 
EndIf

        EndSwitch

    WEnd
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐