Skip to content

raylib.IsGamepadButtonPressed

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Check if a gamepad button has been pressed once

Parameters

Parameter Default Value Note
gamepad 0
button

Return value

Condition Return Value
(always) number

Notes

Example

raylib.InitWindow 800, 600, "Gamepad Button Pressed Demo"
while not raylib.WindowShouldClose
    raylib.BeginDrawing
    raylib.ClearBackground color.white
    if raylib.IsGamepadButtonPressed(0, raylib.GAMEPAD_BUTTON_LEFT_FACE_DOWN) then
        raylib.DrawText "A button just pressed!", 10, 10, 20, color.blue
    end if
    raylib.EndDrawing
end while
raylib.CloseWindow

Clone this wiki locally