From d0c428b4e0ee4296df5e5293eac269b5176ab608 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Sat, 30 May 2026 10:42:57 +0000 Subject: [PATCH] [Auto] [Improve] Keyboard docs: add just-pressed condition, key name reference, and touch-device caveat --- automated_updates_data.json | 4 +++ docs/gdevelop5/all-features/keyboard/index.md | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/automated_updates_data.json b/automated_updates_data.json index b2d10e2b2e..faedd23751 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-05-30", + "summary": "Improved keyboard docs: added touch-device caveat, 'Any key released' and 'Key just pressed' conditions (held vs single-frame distinction), and a full reference of valid key names for text expressions" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcb..3b415efa69 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -5,10 +5,18 @@ 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 touchscreen devices, use the [mouse/touch](/gdevelop5/all-features/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. +## Any key released + +The corresponding actions are performed 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. @@ -21,12 +29,18 @@ Whenever the key selected while setting this condition is released, the correspo 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 stays true for as long as the key is **held down**. To run an action only once when the key starts being pressed (for example to make a character jump), use **Key just pressed** instead. + !!! danger Make sure that the key name is surrounded by quotes. ![](/gdevelop5/all-features/annotation_2019-06-20_191229.png) +## Key just pressed (text expression) + +This condition is true only during the single frame in which the key starts being pressed. It is useful for one-shot actions (jumping, validating a menu, firing a single shot...) so that holding the key down does not repeat the action every frame. + ## 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. @@ -37,6 +51,21 @@ To test a key release using this condition, you need to enter the key name in th "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". +## Key names + +When a condition or expression asks for a key name as text, use one of these names (case sensitive): + +- **Letters**: `a` to `z` (always lowercase, regardless of Shift or Caps Lock). +- **Numbers**: `Num0` to `Num9` (top row) and `Numpad0` to `Numpad9` (numeric keypad). +- **Arrow keys**: `Left`, `Up`, `Right`, `Down`. +- **Modifiers**: `LShift`, `RShift`, `LControl`, `RControl`, `LAlt`, `RAlt`, `LSystem`, `RSystem` (the left/right Windows or Command key). +- **Function keys**: `F1` to `F12`. +- **Editing & navigation**: `Space`, `Return`, `Back` (Backspace), `Tab`, `Delete`, `Insert`, `Escape`, `Home`, `End`, `PageUp`, `PageDown`, `Pause`, `Menu`. +- **Punctuation**: `SemiColon`, `Comma`, `Period`, `Quote`, `Slash`, `BackSlash`, `Equal`, `Dash`, `Tilde`, `LBracket`, `RBracket`. +- **Numpad operators**: `Add`, `Subtract`, `Multiply`, `Divide` (and their `Numpad`-prefixed variants). + +The left and right variants of a key (such as `LShift`/`RShift`) are reported separately, so a key picker or the "Last pressed key" expression will return the specific side that was used. + ## Reference All actions, conditions and expressions are listed in [the keyboard reference page](/gdevelop5/all-features/keyboard/reference/). \ No newline at end of file