Skip to content

WaitMouse

Narta Xaymar Dirks edited this page Nov 1, 2026 · 7 revisions

Blitz3DBlitzPlusBlitzBasic

WaitMouse

WaitMouse:Int32

Returns: The number of the button that was pressed.

Description

Stops the program until a mouse button is pressed and returns its number. Presses made before the call count too, so call FlushMouse first if only a new click should end the wait. In a game loop prefer MouseHit or GetMouse, which let the screen keep updating.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
FlushMouse
Text 10, 10, "Click a mouse button"
Flip
Local b = WaitMouse()
Cls
Text 10, 10, "Button " + b + " was pressed"
Flip
Delay 1000

Related Commands

FlushMouse, GetMouse, LastMouseDevice, LockMouse, MouseChanged, MouseWait, MoveMouse, UnlockMouse

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally