Skip to content

raylib.IsGamepadButtonDown

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check if a gamepad button is being pressed

Parameters

Parameter Default Value Note
gamepad 0
button

Return value

Condition Return Value
(always) number

Notes

Example

raylib.InitWindow 800, 600, "Gamepad Button Down Demo"
while not raylib.WindowShouldClose
    raylib.BeginDrawing
    raylib.ClearBackground color.white
    if raylib.IsGamepadButtonDown(0, raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN) then
        raylib.DrawText "A button held", 10, 10, 20, color.green
    end if
    raylib.EndDrawing
end while
raylib.CloseWindow

Clone this wiki locally