Detecting Mouse Release


Attention! 👉Starting November 2024, BlitzCoder.org will now be BlitzBasic.org.

 

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