-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.IsKeyDown
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check if a key is being pressed (key held down)
| Parameter | Default Value | Note |
|---|---|---|
| key |
| Condition | Return Value |
|---|---|
| (always) | number |
raylib.InitWindow 800, 600, "Key Down Demo"
x = 400
while not raylib.WindowShouldClose
if raylib.IsKeyDown(raylib.KEY_RIGHT) then x = x + 4
if raylib.IsKeyDown(raylib.KEY_LEFT) then x = x - 4
raylib.BeginDrawing
raylib.ClearBackground color.white
raylib.DrawCircle x, 300, 20, color.blue
raylib.EndDrawing
end while
raylib.CloseWindow