Detecting Mouse Release


👉 BlitzCoder will be building a new platform and other plans to preserve and continue the Blitz legacy.

To be able to achieve this goal, we need your support by becoming a Patreon Paid Member 👈

 

Tweet blitz3d blitzplus code-archives tutorials
BlitzCoder

Short code in checking for mouse up or release.

; For inner - how to do a "mouse released" or "mouse up"
; By Rob Cummings (rob@redflame net)

Global oldbutton,newbutton

While Not KeyHit(1)
    If MouseUp() Then Print "MOUSEUP!"
    UpdateMouse()
Wend
End

Function updatemouse()
    oldbutton=newbutton
    newbutton=MouseDown(1)
End Function

Function MouseUp()
    If oldbutton=1 And newbutton=0 Return 1
End Function

Reply To Topic (minimum 10 characters)

Please log in to reply