From 0b8fd7629f5101025f9c317d9b96d6faee8ca6bf Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Wed, 17 Jun 2026 11:42:33 +0000 Subject: [PATCH] [Auto] [Improve] Updated keyboard docs with just-pressed condition, key selection, and touchscreen note --- automated_updates_data.json | 4 +++ docs/gdevelop5/all-features/keyboard/index.md | 34 +++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index eb14cff8ead..a3c7fb7154a 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -92,6 +92,10 @@ { "date": "2026-04-22", "summary": "Improved resources-loading docs (named Preload scene action, documented SceneLoadingProgress expression and AreSceneAssetsLoaded condition, clarified custom loading screen approach) and added extension lifecycle functions table to events/functions docs" + }, + { + "date": "2026-06-17", + "summary": "Improved keyboard docs: added 'Key just pressed' vs 'Key pressed' distinction, 'Any key released' condition, touchscreen warning, key picker/expression selection, and last-pressed-key use case" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcbe..16be1897223 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -3,39 +3,39 @@ 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. + Keyboard conditions do not work with the on-screen keyboard of touch devices. When making a game for mobile or touchscreen devices, use the mouse/touch conditions instead. -## Key pressed +## Selecting a key -Whenever the key selected while setting this condition is pressed, the corresponding actions are performed. +When setting a "Key pressed" or "Key released" condition, you choose the key to check from a drop-down list (for example `Left`, `Space`, `Return`, `LShift`...). If you need the key to be dynamic, click "Use an expression" to instead provide the key name as a text expression, which is useful for customizable controls (for example, reading the key name from a variable). -## Key released +## Key pressed -Whenever the key selected while setting this condition is released, the corresponding actions are performed. +This condition is true as long as the selected key is held down. Use it for continuous actions, such as moving a character while an arrow key stays pressed. -## Key pressed (text expression) +## Key just pressed -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. +This condition is true only during the frame in which the key is pressed down. Use it for one-shot actions that should happen once per press, such as jumping or opening a menu, so that holding the key does not trigger the action repeatedly. -!!! danger +## Key released - Make sure that the key name is surrounded by quotes. +This condition is true during the frame in which the selected key is released. -![](/gdevelop5/all-features/annotation_2019-06-20_191229.png) +## Any key pressed -## Key released (text expression) +This condition is true if any key on the keyboard is pressed. -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. +## Any key released -![](/gdevelop5/all-features/annotation_2019-06-20_191302.png) +This condition is true if any key on the keyboard was just released. -## 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 latest key pressed on the keyboard, as a string. For example, if the last key pressed is the left arrow key, the expression returns "Left". This is handy for building key-rebinding screens that capture the key a player presses. ## Reference