From b0204ad5c528b0a5e75aa8b56d5674198a41fe72 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Thu, 21 May 2026 11:17:00 +0000 Subject: [PATCH] [Auto] [Improve] Clarified keyboard input conditions and fixed screenshot extension example syntax --- automated_updates_data.json | 4 +++ docs/gdevelop5/all-features/keyboard/index.md | 33 +++++++++---------- .../all-features/screenshot/index.md | 10 ++++-- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index 963bfb8c41..48dd4dd6e8 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-21", + "summary": "Improved keyboard docs (added Key just pressed condition, Any key released, clarified held-vs-just-pressed behavior, touchscreen warning) and screenshot docs (added desktop-only platform warning, fixed broken FileSystem expression syntax in example)" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcb..ea9b1a8c93 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -5,37 +5,34 @@ title: Keyboard GDevelop gives access to all inputs made on the keyboard. This includes conditions to check if a key was 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 only work with a physical keyboard. They do not detect input from on-screen (virtual) keyboards on touch devices. For games targeting mobile or touchscreen devices, use [mouse and touch](/gdevelop5/all-features/mouse-touch) conditions instead, or the [Text Input](/gdevelop5/objects/text_input) object for text fields. -## 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 conditions that look similar but behave differently: -## Key released - -Whenever the key selected while setting this condition is released, the corresponding actions are performed. - -## 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. +- **Key pressed** stays true *as long as the key is held down*. Use it for continuous actions like moving a character left while the left arrow is held. +- **Key just pressed** is only true *on the frame when the key starts being pressed*. Use it for one-shot actions like jumping, firing a single shot, or toggling a menu — even if the player keeps holding the key, the condition only triggers once. -!!! danger - - Make sure that the key name is surrounded by quotes. +To check the key, enter its name as a text expression (between quotes). For example, type `"Left"` to check the left arrow key, `"Space"` for the space bar, or `"a"` for the letter A. ![](/gdevelop5/all-features/annotation_2019-06-20_191229.png) -## Key released (text expression) +## Key released -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 **Key released** condition is true on the frame when a held key is released. It is commonly paired with **Key just pressed** to detect a complete press-and-release gesture (for example, charging a shot while a key is held, then firing when it is released). ![](/gdevelop5/all-features/annotation_2019-06-20_191302.png) -## Last key pressed +## Any key pressed / Any key released + +These conditions are true whenever *any* key on the keyboard is pressed or released. They are useful for "Press any key to continue" screens or to detect when the player is interacting with the keyboard at all. + +## 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 **LastPressedKey** expression returns the name of the latest key pressed on the keyboard, as a string (for example `"Left"`, `"Space"` or `"a"`). This is convenient to display the name of the key used for an action, or to let the player rebind controls by capturing whichever key they press next. ## Reference diff --git a/docs/gdevelop5/all-features/screenshot/index.md b/docs/gdevelop5/all-features/screenshot/index.md index bb4518a422..7b41f66580 100644 --- a/docs/gdevelop5/all-features/screenshot/index.md +++ b/docs/gdevelop5/all-features/screenshot/index.md @@ -5,19 +5,23 @@ title: Screenshot extension This extension lets you save a screenshot of the running game in a specified folder. +!!! warning + + The **Take screenshot** action only works on **Windows, Linux and macOS** desktop builds (and during a preview in the GDevelop editor). It does not work on HTML5/web exports, Android or iOS, because those platforms do not allow games to write arbitrary files to disk. + Note: As of GDevelop 5.0.0-beta92 the screenshot action is no longer an extension. Just add an action and search for `screenshot` or go to `Other Actions`/`Screenshot`/`Take screenshot`. ### Actions #### Take screenshot -Use this action to save a screenshot of everything which is currently drawn on the game window into a *png* file. +Use this action to save a screenshot of everything which is currently drawn on the game window into a *png* file. If the save path does not end with `.png`, the extension is added automatically. ##### Parameters: **Save path**: The file path where the screenshot should be saved. -The save path needs to be an absolute path on the file system (Like "C:\MyFolder\MyScreenshot.png" on Windows)' +The save path needs to be an absolute path on the file system (like `C:\MyFolder\MyScreenshot.png` on Windows). Relative paths are not supported. @@ -29,7 +33,7 @@ Relative paths are not supported. This path: -``` () + () + "my_screenshot.png" ``` +``` FileSystem::PicturesPath() + FileSystem::PathDelimiter() + "my_screenshot.png" ``` This will save the screenshot to the *Pictures* folder on Windows, Linux and MacOS.