You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check if a mouse button is being pressed
Parameters
Parameter
Default Value
Note
button
Return value
Condition
Return Value
(always)
number
Notes
Example
raylib.InitWindow800, 600, "Mouse Button Down Demo"whilenotraylib.WindowShouldCloseraylib.BeginDrawingraylib.ClearBackgroundcolor.whiteifraylib.IsMouseButtonDown(raylib.MOUSE_BUTTON_LEFT) thenraylib.DrawText"Left button held", 10, 10, 20, color.redelseraylib.DrawText"Click and hold the left button", 10, 10, 20, color.blackendifraylib.EndDrawingendwhileraylib.CloseWindow