Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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-22",
"summary": "Improved keyboard docs (added Key just pressed vs Key pressed distinction, touch-device caveat, comprehensive key name list, control remapping use case) and window docs (clarified game resolution vs window size, documented resize mode, center window action, and runtime size expressions)"
}
]
}
38 changes: 28 additions & 10 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,55 @@ 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 do not work with the on-screen keyboard on touch devices. For mobile or touchscreen games, rely on the [mouse/touch conditions](/gdevelop5/all-features/mouse-touch) instead.

## Key pressed
## Any key pressed / Any key released

Whenever the key selected while setting this condition is pressed, the corresponding actions are performed.
These conditions are true when any key on the keyboard is pressed (held) or has just been released. They are convenient for "Press any key to start" prompts.

## Key pressed vs Key just pressed

GDevelop offers two distinct conditions to detect a key press:

- **Key pressed** stays true *as long as* the key is held down. Use it for continuous actions like moving a character while an arrow key is held.
- **Key just pressed** is true only on the single frame when the key was first pressed. Use it for one-shot actions like opening a menu, jumping, or shooting — even if the player keeps the key held, the action will only trigger once.

## Key released

Whenever the key selected while setting this condition is released, the corresponding actions are performed.

## Key pressed (text expression)
## Key pressed / released / just 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 event using a text expression, you need to enter the key name in the form of a text expression. For example, to check for the left arrow key, you would enter `"Left"` in the field.

!!! danger

Make sure that the key name is surrounded by quotes.

![](/gdevelop5/all-features/annotation_2019-06-20_191229.png)

## Key released (text expression)
This is useful when the key to check is dynamic — for example, when reading the key to use from a player setting stored in a variable, or when implementing remappable controls.

### Key names

The key name used in expressions matches the value returned by **Last pressed key**. Common key names include:

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.
- Letter keys: `"a"` to `"z"` (lowercase)
- Number row: `"Num0"` to `"Num9"`
- Numpad: `"Numpad0"` to `"Numpad9"`, `"NumpadAdd"`, `"NumpadSubtract"`, `"NumpadMultiply"`, `"NumpadDivide"`, `"NumpadReturn"`
- Arrows: `"Left"`, `"Right"`, `"Up"`, `"Down"`
- Modifiers: `"LShift"`, `"RShift"`, `"LControl"`, `"RControl"`, `"LAlt"`, `"RAlt"`, `"LSystem"`, `"RSystem"` (Windows/Cmd key)
- Function keys: `"F1"` to `"F12"`
- Other: `"Space"`, `"Return"` (Enter), `"Tab"`, `"Escape"`, `"Back"` (Backspace), `"Delete"`, `"Insert"`, `"Home"`, `"End"`, `"PageUp"`, `"PageDown"`
- Punctuation: `"SemiColon"`, `"Comma"`, `"Period"`, `"Quote"`, `"Slash"`, `"BackSlash"`, `"Equal"`, `"Dash"`, `"LBracket"`, `"RBracket"`, `"Tilde"`

![](/gdevelop5/all-features/annotation_2019-06-20_191302.png)
Left and right modifier keys (Shift, Control, Alt) are distinct: a condition checking `"LShift"` is not triggered when the right Shift key is pressed.

## Last key pressed

"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 last key press as a string (for example, `"Left"` for the left arrow). This is convenient for control remapping: when waiting for the player to press a key to bind, read this expression after the **Any key pressed** condition becomes true and store the result in a variable.

## Reference

Expand Down
44 changes: 37 additions & 7 deletions docs/gdevelop5/all-features/window/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,43 @@ The margin of the window is the distance between the side of the window and the

Notice the black borders on all for sides of the window. The width of the borders is 100px.

## Size of the window
## Game resolution vs game window size

Size of the window is the number of pixels visible in the game. The "Width" field refers to the number of pixels in the horizontal directions while the "Height" field refers to the number of pixels in the vertical direction.
GDevelop distinguishes two related but separate concepts:

While setting the size of the window, if you want to scale the current area to the set resolution, choose "NO". This will decrease the visual quality of the game if the size entered is lower than default and will increase the visual quality if the size entered is higher than the default size.
- The **game resolution** is the size of the *internal drawing area* — the number of pixels the game renders. This is what your `SceneWindowWidth()` and `SceneWindowHeight()` expressions return.
- The **game window size** is the size of the actual window on the user's screen, in screen pixels.

![](/gdevelop5/all-features/annotation_2019-06-29_175454.png)
The renderer fits the game resolution into the window, scaling it up or down. A 320×240 game resolution displayed in an 800×600 window is upscaled; the player sees larger pixels, but the playable area in game coordinates stays at 320×240.

If you want to scale the set resolution to the window area, choose "YES". This will crop the window and display only the number of pixels entered in the action. This does not affect the visual quality as long as the game is scaled up or down because of the size of the system window.
### Game resolution

Use the **Game resolution** action to change the internal rendering size. This is what changes the area visible to the player in game coordinates without affecting the actual window.

### Game window size

Use the **Game window size** action to resize the window itself. Its parameter "Also update the game resolution?" decides what happens to the game area:

- If **yes**, the game resolution is updated to match the new window — the player will see more (or less) of the scene.
- If **no**, the existing resolution is stretched or shrunk to fit the new window, possibly distorting the image.

!!! note

The game is cropped starting from the top-left corner of the game.
Resizing the window only works on desktop targets (Windows, macOS, Linux). Browsers and mobile devices control their own window size, so this action has no effect there — but changing the game resolution still works everywhere.

### Resize mode and automatic adaptation

When the player resizes the window (or rotates a mobile device), GDevelop can automatically adapt the game resolution. The **Game resolution resize mode** action takes one of three values:

![](/gdevelop5/all-features/annotation_2019-06-29_175540.png)
- `"adaptWidth"`: the game width follows the window width; the height stays fixed.
- `"adaptHeight"`: the game height follows the window height; the width stays fixed.
- Empty string: resizing is disabled — the resolution stays as set in the game properties and the rendered image is scaled.

Combine this with the **Automatically adapt the game resolution** action to enable or disable the automatic re-adaptation that happens whenever the screen or window size changes during the game.

### Centering the window

The **Center the game window on the screen** action moves the window to the center of the user's screen. It only works on desktop targets (Windows, macOS, Linux).

## Window title

Expand All @@ -39,6 +61,14 @@ By default, the game name is used for the executable name (on Windows, macOS and

With the action to change the title, the title bar on Windows, macOS and Linux will be changed. Nothing will be visible on Android and iOS. For HTML5 games, the web page title will be changed.

## Reading window and screen size

A few expressions let you read sizes at runtime:

- `SceneWindowWidth()` / `SceneWindowHeight()` return the current game resolution (or canvas size in browsers) — what you usually want when positioning UI relative to the visible play area.
- `ScreenWidth()` / `ScreenHeight()` return the size of the user's screen (or of the web page for HTML5 games).
- `WindowTitle()` returns the current window title string.

## Reference

All actions, conditions and expressions are listed in [the window reference page](/gdevelop5/all-features/window/reference/).