From ceb4a041e5ec0be715bb86694e2ea77a1a410a30 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:40:11 +0000 Subject: [PATCH] [Auto] [Improve] Clarify keyboard conditions (held vs just pressed) and add valid key names --- automated_updates_data.json | 4 ++ docs/gdevelop5/all-features/keyboard/index.md | 37 +++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index b2d10e2b2e4..bd5836f3ecc 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-02", + "summary": "Improved keyboard docs: distinguished 'Key pressed' (held) from 'Key just pressed', added 'Any key released', touch-device warning, and a list of valid key names" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcbe..caa8dfa366e 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -5,33 +5,48 @@ title: Keyboard GDevelop gives access to all inputs made on the keyboard. This includes conditions to check if a key was pressed or released. +!!! warning + + Keyboard conditions do not work with the on-screen keyboard of touch devices. When making a game for mobile or touchscreens, use the mouse/touch conditions instead. + ## Any key pressed -For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed. +This condition is true if any key on the keyboard is currently pressed. + +## Any key released + +This condition is true during the frame in which any key on the keyboard is released. ## Key pressed -Whenever the key selected while setting this condition is pressed, the corresponding actions are performed. +This condition stays true for as long as the chosen key is held down. Use it for continuous actions, such as moving a character while a key remains pressed. + +## Key just pressed + +This condition is only true during the single frame in which the chosen key is pressed down. Use it when an action should happen once per press, such as jumping or firing, so that holding the key down does not repeat the action every frame. ## Key released -Whenever the key selected while setting this condition is released, the corresponding actions are performed. +This condition is true during the frame in which the chosen key is released. -## Key pressed (text expression) +## Choosing the key to check -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 these conditions, you can either pick a key from the selector or enter the key name as a text expression (for example to check a key stored in a variable). When typing the name, make sure it is surrounded by quotes, for example `"Left"`. !!! 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. +The valid key names are: -![](/gdevelop5/all-features/annotation_2019-06-20_191302.png) +* Letters: `a` to `z` +* Top-row digits: `Num0` to `Num9` — Numpad digits: `Numpad0` to `Numpad9` +* Arrows: `Left`, `Up`, `Right`, `Down` (and the numpad arrows `NumpadLeft`, `NumpadUp`, `NumpadRight`, `NumpadDown`) +* Modifiers: `LShift`, `RShift`, `LControl`, `RControl`, `LAlt`, `RAlt`, `LSystem`, `RSystem` +* Function keys: `F1` to `F12` +* Navigation: `Space`, `Return`, `Back` (Backspace), `Tab`, `Delete`, `Insert`, `Escape`, `PageUp`, `PageDown`, `End`, `Home`, `Pause`, `Menu` +* Symbols: `SemiColon`, `Comma`, `Period`, `Quote`, `Slash`, `BackSlash`, `Equal`, `Dash`, `LBracket`, `RBracket`, `Tilde` +* Numpad operators: `Add`, `Subtract`, `Multiply`, `Divide` (and `NumpadAdd`, `NumpadSubtract`, `NumpadMultiply`, `NumpadDivide`) ## Last key pressed