# keyDown [Built-ins](README.md) Canonical ID: `input.keyDown`. Nederlands: `toetsIngedrukt`. Asks whether a key is held down **right now** and returns a Boolean: `true` or `false`. Repeatedly asking for the current state is called **polling**. It does not wait for a new press or create a handler that listens for future presses. For a block that starts at the moment a key is pressed, use [keyPressed](keyPressed.md). The host, the app running the program, supplies the key state. The portable game names are `"left"`, `"right"`, `"up"`, `"down"`, and `"space"`. Native graphical hosts also support common control keys and basic Latin letters and digits (ASCII). A key the host does not provide is reported as not down. Key names are text data and stay the same when you translate source syntax. ## Signature ```text keyDown(key) ``` ## Arguments | Parameter | Type | Requirement | |---|---|---| | `key` | Text | Nonempty host key name; data values are not translated. | ## Return value `Boolean`. ## Example ```pliro # language: en when started(): let x = 320 for frame in repeatList(50, none): if keyDown("left"): set x = x - 2 clearCanvas("white") circle(x, 180, 15, "blue") wait(0.04) ``` For about two seconds, holding Left moves the circle left in a graphical host. ## Notes and common mistakes Use the function name for your source language. Its [canonical ID](../concepts/canonical-identity.md) is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented [arguments](../concepts/parameters-and-arguments.md) and value types. Pliro reports mismatches when checking can detect them, or when the call runs. The selected host mediates input. Program replies are bounded to 64 KiB of valid [UTF-8](../concepts/utf-8.md); unavailable input produces E4010. Keyboard names and option strings are data and are not translated with source syntax. Completed prompts are cooperative checkpoints. ## Related entries [ask](ask.md) · [askNumber](askNumber.md) · [askYesNo](askYesNo.md) · [choose](choose.md) · [Programming guides](../guides/input.md) · [Host support](../guides/hosts.md) · [Calls and arguments](../syntax/calls.md)