Microsoft Small Basic
Program Listing: MWC343
' These are samples for Mouse object
' To hode mouse pointer (cursor) 3 sec
Mouse.HideCursor()
Program.Delay(3000)
' To show mouse pointer (cursor)
Mouse.ShowCursor()
' To show which mouse button is down in the graphics window title
GraphicsWindow.MouseDown = OnMouseDownOrUp
GraphicsWindow.MouseUp = OnMouseDownOrUp
Sub OnMouseDownOrUp
msg = ""
If Mouse.IsLeftButtonDown Then
msg = "Left "
EndIf
If Mouse.IsRightButtonDown Then
msg = msg + "Right"
EndIf
GraphicsWindow.Title = msg
EndSub
' To show mouse position (desktop coordinate)
GraphicsWindow.BrushColor = "Black"
txtPos = Shapes.AddText("")
Shapes.Move(txtPos, 10, 10)
While "True"
pos = Mouse.MouseX + "," + Mouse.MouseY
Shapes.SetText(txtPos, pos)
Program.Delay(1)
EndWhile