mouse.LeftButton

( Brutus2D 1.7 )

mouse.LeftButton - check if the left mouse button is pressed

Description

pressed = mouse.LeftButton

  • pressed - true or false

mouse.LeftButton checks to see if the player is pressing the left mouse button. If he is, then it returns true. If not, it returns false.

Examples

graphics.Initialize
key.Initialize
mouse.Initialize

dim font
font = graphics.CreateFont("system",10)

Do
    graphics.Clear
    graphics.SetText "Press a mouse button!", 10, 10, font
    If mouse.LeftButton Then graphics.SetText "Left button is pressed.", 10, 25, font
    If mouse.MiddleButton Then graphics.SetText "Middle button is pressed.", 10, 40, font
    If mouse.RightButton Then graphics.SetText "Right button is pressed.", 10, 55, font
    graphics.Display
Loop Until key.Pressed(vk_escape) or key.Pressed(vk_windowx)

graphics.Terminate
key.Terminate
mouse.Terminate

Related Pages

page tags: button input mouse
page_revision: 1, last_edited: 1214408900|%e %b %Y, %H:%M %Z (%O ago)