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-23",
"summary": "Improved keyboard docs (added Key just pressed distinction, Any key released, complete list of valid key names, on-screen keyboard warning) and window docs (game resolution vs window size, resize modes, center window, window icon, screen/scene/color-depth expressions)"
}
]
}
39 changes: 30 additions & 9 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,58 @@ 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 on-screen keyboards on touch devices. When making a game for mobile or touch devices, use the mouse/touch conditions instead.

## 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 distinct ways to detect a key press:

## Key released
- **Key pressed** is true as long as the key is held down (it stays true frame after frame while the user holds the key).
- **Key just pressed** is true only on the single frame when the key starts being pressed.

Whenever the key selected while setting this condition is released, the corresponding actions are performed.
Use *Key just pressed* for actions that should happen once per press (jump, fire a single shot, validate a menu choice) and *Key pressed* for continuous behaviors (move while held, charge a shot).

## Any key pressed / Any key released

These conditions trigger when *any* key on the keyboard is pressed or released during the frame. They are useful, for example, to dismiss a splash screen or "Press any key" prompts.

## 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 text expression. For example, if you want to check the left arrow key press, you need to 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)

This text-expression variant is mostly useful when the key to check is stored in a variable (for example, a customizable control scheme where the player picks their own keys).

### Valid key names

The following key names can be used in any text-based key condition or compared against the *Last pressed key* expression:

- **Letters** (lowercase): `a`, `b`, `c`, …, `z`
- **Number row**: `Num0` to `Num9`
- **Numpad digits**: `Numpad0` to `Numpad9`
- **Function keys**: `F1` to `F12`
- **Arrows**: `Left`, `Up`, `Right`, `Down` (and `NumpadLeft`, `NumpadUp`, `NumpadRight`, `NumpadDown`)
- **Modifiers**: `LShift`, `RShift`, `LControl`, `RControl`, `LAlt`, `RAlt`, `LSystem`, `RSystem` (Windows / Command keys)
- **Editing & navigation**: `Space`, `Return`, `Back` (Backspace), `Tab`, `Delete`, `Insert`, `Escape`, `Home`, `End`, `PageUp`, `PageDown`, `Pause`, `Menu`
- **Punctuation & symbols**: `SemiColon`, `Comma`, `Period`, `Quote`, `Slash`, `BackSlash`, `Equal`, `Dash`, `LBracket`, `RBracket`, `Tilde`
- **Numpad operators**: `Add`, `Subtract`, `Multiply`, `Divide` (and `NumpadAdd`, `NumpadSubtract`, `NumpadMultiply`, `NumpadDivide`, `NumpadReturn`, `NumpadHome`, `NumpadEnd`, `NumpadPageUp`, `NumpadPageDown`)

## 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.
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 the left arrow key release, you need to enter `"Left"` in the field.

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

## 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 latest key pressed on the keyboard, as a string (e.g. `"Left"`, `"Space"`, `"a"`). Combined with the key names listed above, this is convenient when implementing key remapping menus: store the result of this expression in a variable and use it later in *Key pressed (text expression)* conditions.

## Reference

Expand Down
41 changes: 34 additions & 7 deletions docs/gdevelop5/all-features/window/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,41 @@ The window of the game is the area in which the game is displayed. It DOES NOT r
## Fullscreen
The "De/activate fullscreen" action allows you to toggle the game between fullscreen on/off. When the window is in fullscreen, it will take up as much area as possible. You can control the action using the "YES" and "NO" actions.

The action also accepts a *Keep aspect ratio* parameter (HTML5 games only). When set to "yes", the game keeps its original ratio and black bars are added on the sides or the top/bottom if the screen ratio differs. Set it to "no" to stretch the game to fill the screen.

You can use the "Fullscreen activated?" condition to check if the game is currently in fullscreen.

## Window margins
The margin of the window is the distance between the side of the window and the game window displayed. Shown below is the preview of a game with 100 px margins on all 4 sides.

![](/gdevelop5/all-features/annotation_2019-06-29_174027.png)

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.
It is important to distinguish two 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.
- **Game resolution** is the number of pixels the game renders (the size of the game's "canvas" in pixels). Use the action **"Game resolution"** to change it. This does not change the window size — the rendered image is stretched/scaled to fit the window.
- **Game window size** is the size of the system window in which the game is displayed (only meaningful on Windows, macOS and Linux — browser and mobile platforms cannot change their window size). Use the action **"Game window size"** to change it. This action has an *Also update the game resolution?* option — set it to "no" if you want the existing resolution to be stretched into the new window, "yes" to update both at once.

![](/gdevelop5/all-features/annotation_2019-06-29_175454.png)

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.
![](/gdevelop5/all-features/annotation_2019-06-29_175540.png)

!!! note
### Resize mode

The game is cropped starting from the top-left corner of the game.
Use the action **"Game resolution resize mode"** to control how the game adapts when the window or screen size changes:

![](/gdevelop5/all-features/annotation_2019-06-29_175540.png)
- `adaptWidth`: the game width is updated to fit the window/screen, keeping the height fixed.
- `adaptHeight`: the game height is updated, keeping the width fixed.
- *Empty string*: disables automatic resizing. The game keeps its initial resolution and is stretched or letterboxed to fit.

You can also use the action **"Automatically adapt the game resolution"** to turn this resize behavior on or off during the game.

## Center the game window

The action **"Center the game window on the screen"** repositions the system window on the screen. This only works on Windows, macOS and Linux (it has no effect on the web or on mobile).

## Window title

Expand All @@ -39,6 +52,20 @@ 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.

The current title can be retrieved at runtime with the *WindowTitle()* string expression.

## Window icon

Use the action **"Window's icon"** to change the icon of the game's window at runtime, pointing to an image resource of the project. This is most relevant on Windows, macOS and Linux.

## Reading the window and screen size

Several expressions are available to read the current dimensions:

- *SceneWindowWidth()* and *SceneWindowHeight()*: size of the rendered scene (the game canvas), in game pixels — useful to position UI elements relative to the visible area.
- *ScreenWidth()* and *ScreenHeight()*: size of the user's full screen (or, for HTML5 games in a browser, the size of the page).
- *ColorDepth()*: color depth, in bits per pixel.

## Reference

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