-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.IsKeyPressed
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check if a key has been pressed once
| Parameter | Default Value | Note |
|---|---|---|
| key |
| Condition | Return Value |
|---|---|
| (always) | number |
raylib.InitWindow 800, 600, "Key Pressed Demo"
count = 0
while not raylib.WindowShouldClose
if raylib.IsKeyPressed(raylib.KEY_SPACE) then count = count + 1
raylib.BeginDrawing
raylib.ClearBackground color.white
raylib.DrawText "Space presses: " + count, 10, 10, 20, color.black
raylib.EndDrawing
end while
raylib.CloseWindow