04-25-2024, 01:06 AM
Mouse your mouse events outside the update loop:
This fixes any issues on my system. Honestly, the only thing that needs to go inside that WHILE_WEND loop is your scrollwheel code.
Code: (Select All)
Dim As _Byte leftClick, started
Dim startTime As Long
Screen _NewImage(800, 600, 32)
Do
While _MouseInput: Wend
leftClick = _MouseButton(1)
mouseX = _MouseX
mouseY = _MouseY
If leftClick Then
If Not started Then startTime = Timer: started = -1
If Timer - startTime > 1.5 Then ' no holding the button down forever!
leftClick = 0 ' kill left click
started = 0 ' reset timer
Sound 1000, .7 ' pip
End If
_PrintString (380, 280), "Button Down"
_PrintString (380, 320), Str$(Timer - startTime)
End If
If Not leftClick Then ' if buttonUP then reset timer and erase
Cls
started = 0
End If
_Limit 30
Loop Until _KeyDown(27)
System
This fixes any issues on my system. Honestly, the only thing that needs to go inside that WHILE_WEND loop is your scrollwheel code.