Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Mouse Issue?
#2
Mouse your mouse events outside the update loop:

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.
Reply


Messages In This Thread
Another Mouse Issue? - by NakedApe - 04-25-2024, 12:54 AM
RE: Another Mouse Issue? - by SMcNeill - 04-25-2024, 01:06 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 01:40 AM
RE: Another Mouse Issue? - by NakedApe - 05-01-2024, 11:42 PM
RE: Another Mouse Issue? - by SMcNeill - 05-02-2024, 12:23 AM
RE: Another Mouse Issue? - by Pete - 04-25-2024, 01:27 AM
RE: Another Mouse Issue? - by bplus - 04-25-2024, 01:42 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 02:08 AM
RE: Another Mouse Issue? - by NakedApe - 04-25-2024, 02:16 AM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 05:33 AM
RE: Another Mouse Issue? - by a740g - 04-26-2024, 02:23 AM
RE: Another Mouse Issue? - by bplus - 04-25-2024, 11:50 AM
RE: Another Mouse Issue? - by NakedApe - 04-25-2024, 04:11 PM
RE: Another Mouse Issue? - by TerryRitchie - 04-25-2024, 05:43 PM
RE: Another Mouse Issue? - by NakedApe - 04-26-2024, 06:19 AM
RE: Another Mouse Issue? - by TerryRitchie - 05-02-2024, 12:31 AM
RE: Another Mouse Issue? - by SMcNeill - 05-02-2024, 12:31 AM
RE: Another Mouse Issue? - by NakedApe - 05-02-2024, 03:16 AM



Users browsing this thread: 2 Guest(s)