From 6a756fb5c08275a494fb3975d97d8e9d69e25c0d Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Sat, 13 Jun 2026 10:56:58 +0000 Subject: [PATCH] [Auto] [Improve] Document keyboard "Key just pressed", touch-device warning, and valid key names --- automated_updates_data.json | 4 ++++ docs/gdevelop5/all-features/keyboard/index.md | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index b2d10e2b2e4..d8032f338e6 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-13", + "summary": "Improved keyboard docs: added 'Key just pressed' vs held-key distinction, 'Any key released' condition, touch-device warning, and valid key name reference (left/right modifiers, Numpad, arrows)" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcbe..ac4086b6b23 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -3,11 +3,15 @@ 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. + +!!! warning + + Keyboard conditions do not work with the on-screen keyboard on touch devices. When making a game for mobile or touchscreen devices, use the [mouse/touch conditions](/gdevelop5/all-features/mouse-touch) instead. ## Any key pressed -For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed. +For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed. There is also an "Any key released" condition that triggers when any key is released, which is handy to detect "press any key to continue" interactions. ## Key pressed @@ -17,14 +21,20 @@ Whenever the key selected while setting this condition is pressed, the correspon Whenever the key selected while setting this condition is released, the corresponding actions are performed. +## Key just pressed + +Whereas "Key pressed" stays true the whole time a key is held down, "Key just pressed" is only true during the single frame when the key goes down. Use it for actions that should happen once per key press (jumping, firing a shot, validating a menu choice) rather than repeating every frame while the key is held. + ## Key pressed (text expression) -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. +To test a key press using this condition, you need to enter the key name in the form of a text expression. For example, if you want to check the condition for the left arrow key press, you need to enter "Left" in the field. !!! danger Make sure that the key name is surrounded by quotes. +Left and right modifier keys are distinguished, so use "LShift"/"RShift", "LControl"/"RControl" and "LAlt"/"RAlt". Other common names include "Space", "Return", the arrow keys ("Left", "Right", "Up", "Down"), the number row ("Num0" to "Num9") and the numeric keypad ("Numpad0" to "Numpad9"). The autocomplete in the key field lists every valid name. + ![](/gdevelop5/all-features/annotation_2019-06-20_191229.png) ## Key released (text expression)