Thursday 31 December 2015

Program that detect mouse left button down or up | Small Basic

The code below simply output a text "Mouse UP" when mouse left button is clicked is up and a text "Mouse Down" when mouse left click is down or clicked.

GraphicsWindow.MouseDown = mousedown
loopz:

If Mouse.IsLeftButtonDown = "False" then
TextWindow.WriteLine("Mouse UP")
endif
Program.Delay(100)
Goto loopz

Sub mousedown
  If Mouse.IsLeftButtonDown = "True" Then
    TextWindow.WriteLine("Mouse DOWN")
  EndIf
EndSub

No comments:

Post a Comment