; MouseDown Example ; ----------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; Hide the Windows pointer - the example draws its own crosshair HidePointer While Not KeyDown(1) Cls mx=MouseX() my=MouseY() ; MouseDown returns 1 for as long as a button is HELD. ; Button numbers: 1=left, 2=right, 3=middle. ; (Compare MouseHit, which reports each click only once.) If MouseDown(1) Then ; A continuous laser beam streams from the turret while the ; left button stays held Color 255,60,60 Line 318,460,mx,my Line 322,460,mx,my End If ; Turret base Color 200,200,200 Rect 300,460,40,20,True ; Crosshair Color 255,255,0 Oval mx-10,my-10,20,20,False Line mx-14,my,mx+14,my Line mx,my-14,mx,my+14 Color 255,255,255 Text 0,0,"Hold the left button to fire the laser Esc: exit" Text 0,20,"MouseDown(1)="+MouseDown(1)+" MouseDown(2)="+MouseDown(2)+" MouseDown(3)="+MouseDown(3) Flip Wend End