Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
{
"date": "2026-06-24",
"summary": "Improved window docs: distinguished game resolution from window size, documented resize mode and auto-adapt, added center window and window icon actions, and listed scene/screen size expressions"
},
{
"date": "2026-06-29",
"summary": "Improved keyboard docs: explained Key pressed vs Key just pressed, added Any key released, noted touch-device limitation, clarified text-expression key and Last pressed key for remapping"
}
]
}
29 changes: 16 additions & 13 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,42 @@ title: Keyboard
---
# Keyboard

GDevelop gives access to all inputs made on the keyboard. This includes conditions to check if a key was pressed or released.
GDevelop gives access to all inputs made on the keyboard. This includes conditions to check if a key is pressed or released.

## Any key pressed
!!! warning

For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed.
These conditions do not work with the on-screen keyboard shown on touch devices. When making a game for mobile/touchscreen devices, use the [mouse/touch](/gdevelop5/all-features/mouse-touch) conditions instead, or the [Text Input](/gdevelop5/objects/text_input) object to capture typed text.

## Key pressed
## Key pressed vs Key just pressed

Whenever the key selected while setting this condition is pressed, the corresponding actions are performed.
There are two similar conditions, and choosing the right one matters:

* **Key pressed** stays true for *every frame* during which the key is held down. Use it for continuous actions, like moving a character as long as an arrow key is held.
* **Key just pressed** is only true for the *single frame* on which the key was first pressed. Use it for one-time actions that should not repeat while the key stays down, such as making a character jump or toggling a menu.

## Any key pressed / Any key released

These conditions are true when any key on the keyboard is pressed (or just released). They are handy to dismiss a screen or start a game with "press any key".

## Key released

Whenever the key selected while setting this condition is released, the corresponding actions are performed.

## Key pressed (text expression)
## Choosing the key

To test a key press using this condition, you need to enter the key name in the form of text expression. For example, if you want to check condition for left arrow key press, you need to enter "Left" in the field.
When setting up a key condition you pick the key from a list. The condition can also be configured to take the key name as a **text expression**, which is useful when the key to check is stored in a variable (for example, for customizable controls). For example, to check the left arrow key, enter "Left" in the field.

!!! danger

Make sure that the key name is surrounded by quotes.

![](/gdevelop5/all-features/annotation_2019-06-20_191229.png)

## Key released (text expression)

To test a key release using this condition, you need to enter the key name in the form of text expression. For example, if you want to check condition for left arrow key release, you need to enter "Left" in the field.

![](/gdevelop5/all-features/annotation_2019-06-20_191302.png)

## Last key pressed
## Last pressed key

"Last key pressed" expression returns the last key press in the form of a string. For example, if the last key press is the left arrow key, the expression will return "Left".
The "Last pressed key" expression returns the name of the most recently pressed key as a string. For example, if the last key pressed is the left arrow key, the expression returns "Left". This is convenient to let the player remap their controls by capturing whichever key they press next.

## Reference

Expand Down