Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best Double Click method....
#4
The time limit is .25 seconds. You can change that as needed. The other buttons can be coded the same as the left. The mouse wheel can be included, just be sure you place it in the While:Wend loop as...

While _MouseInput
mw = mw + _MouseWheel
Wend

Code: (Select All)
Do
mouse clkcnt, lb, rb, mb, mw
Locate 1, 1: Print "Left Click Count: "; clkcnt;: If clkcnt = 2 Then Sound 1000, .1
Locate 2, 1: Print "Left Button Status: "; lb
Locate 3, 1: Print "Middle Button Status:"; mb
Locate 4, 1: Print "Right Button Status: "; rb
Locate 5, 1: Print "Mouse Wheel Status: "; mw: If mw Then _Delay .1 ' Delay allows it to show.
Loop

Sub mouse (clkcnt, lb, rb, mb, mw)
Static z1
If mw Then mw = 0
While _MouseInput
mw = mw + _MouseWheel: If mw Then mw = mw \ Abs(mw) ' Limit to 1 or -1 for up or down.
Wend
If z1 Then If Abs(Timer - z1) > .25 Then z1 = 0: clkcnt = 0
Select Case lb
Case 2: lb = 0 ' Click cycle completed.
Case 1: If _MouseButton(1) = 0 Then lb = 2 ' Button released.
Case -1: lb = 1 ' Button held down.
Case 0: lb = _MouseButton(1)
End Select
Select Case rb
Case 2: rb = 0 ' Click cycle completed.
Case 1: If _MouseButton(2) = 0 Then rb = 2 ' Button released.
Case -1: rb = 1 ' Button held down.
Case 0: rb = _MouseButton(2)
End Select
Select Case mb
Case 2: mb = 0 ' Click cycle completed.
Case 1: If _MouseButton(3) = 0 Then mb = 2 ' Button released.
Case -1: mb = 1 ' Button held down.
Case 0: mb = _MouseButton(3)
End Select
If lb = -1 Then z1 = Timer: clkcnt = clkcnt + 1
End Sub

Pete
Reply


Messages In This Thread
Best Double Click method.... - by Unseen Machine - 10-30-2025, 12:36 AM
RE: Best Double Click method.... - by Pete - 10-30-2025, 03:20 AM
RE: Best Double Click method.... - by Pete - 10-30-2025, 03:53 AM
RE: Best Double Click method.... - by SMcNeill - 10-30-2025, 05:53 AM
RE: Best Double Click method.... - by Pete - 10-30-2025, 08:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Double slit experiment vince 7 1,682 07-18-2024, 11:06 PM
Last Post: Pete
  Click Away Balls bplus 6 1,577 05-16-2022, 01:04 PM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)