How to detect a double click in freebasic?
Thanks in advance.
How to detect a double click in freebasic?
-
- Posts: 49
- Joined: Dec 16, 2011 3:48
-
- Posts: 49
- Joined: Dec 16, 2011 3:48
Re: How to detect a double click in freebasic?
Sorry How to detect a double click in freebasic outside of windows console?(win32)Microsoft® Win32® Programmer's Reference
Last edited by student1347 on Feb 02, 2018 0:39, edited 2 times in total.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: How to detect a double click in freebasic?
Code: Select all
#Include "windows.bi"
Dim As Integer mx, my, mw, mb
Dim As Double timerem
Do
GetMouse(mx, my, mw, mb)
If (mb And 1) Then 'left mouse button
Do
timerem = Timer
Do 'wait for mouse button release
Sleep 1
GetMouse(mx, my, mw, mb)
Loop While (mb And 1)
Do
If ((Timer - timerem) * 1000) > GetDoubleClickTime() Then
Print "single click"
Exit Do, Do
EndIf
GetMouse(mx, my, mw, mb)
If (mb And 1) Then
Print "double click"
Do 'wait for mouse button release
Sleep 1
GetMouse(mx, my, mw, mb)
Loop While (mb And 1)
Exit Do, Do
EndIf
Loop
Loop
EndIf
Loop