DB Classic Snippet.
This is a small function which lets you detect if the left mouse button has been clicked or double-clicked.
If it returns a 1 then the mouse was single-clicked. If it returns 2 then it was double-clicked.
CLS 0
Set Text Opaque
Print "Click Or Double-Click The Left Mouse Button": Print
Do
Action = 0
If MOUSECLICK()=1 Then Action = MouseButton()
If Action = 1 Then Center Text 320,200," Single-Click "
If Action = 2 Then Center Text 320,200," Double-Clicked "
Loop
Function MouseButton()
Rem 200 can be changed to adjust the speed. The smaller the number the quicker
Rem you have to double click - like in the Windows control panel.
Repeat
Until MOUSECLICK()=0
T=Timer()
Repeat
TClock=Timer()-T
Until MOUSECLICK()=1 or TClock=200
If TClock<200
Action = 2
Else
Action = 1
Endif
Repeat
Until MOUSECLICK()=0
EndFunction Action
TDK_Man