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 @@ -80,6 +80,10 @@
{
"date": "2026-03-15",
"summary": "Improved string-instructions (added StrReplaceOne/StrReplaceAll), common-conversions (added LargeNumberToString, ToJSON/ObjectVarToJSON), timers (added TimeScale and Time() format selectors), and gamepad docs (added analog triggers, deadzone, StickForceX/Y, controller type detection)"
},
{
"date": "2026-03-17",
"summary": "Improved window docs (added IsFullScreen condition, CenterWindow, game resolution vs window size, adaptive resolution modes, window icon, and all expressions); improved keyboard docs (clarified Key pressed vs Key just pressed, added Any key released, key name examples, and LastPressedKey$ expression)"
}
]
}
35 changes: 20 additions & 15 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,42 @@ 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
!!! note

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. For mobile or touchscreen games, use [mouse/touch conditions](/gdevelop5/all-features/mouse-touch) 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 similar but distinct conditions for detecting a key press:

- **Key pressed** — Returns `true` on every frame as long as the key is **held down**. Use this for continuous actions like moving a character while a direction key is held.
- **Key just pressed** — Returns `true` only on the **single frame** the key is first pressed. Use this for one-shot actions like jumping, shooting, or opening a menu, where you want the action to fire exactly once per key press.

Using **"Key pressed"** for a jump action, for example, would cause the character to jump repeatedly every frame while the key is held. **"Key just pressed"** triggers the jump only once until the key is released and pressed again.

## Key released

Whenever the key selected while setting this condition is released, the corresponding actions are performed.
The **Key released** condition returns `true` on the single frame a key is let go. Use it to trigger events at the moment of release, such as releasing a charged attack.

## Key pressed (text expression)
## Any key pressed / Any key released

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.
The **Any key pressed** and **Any key released** conditions are true when any key on the keyboard is currently pressed or has just been released. These are useful for "press any key to continue" screens.

!!! danger
## Key names (text expression conditions)

Make sure that the key name is surrounded by quotes.
The key conditions accept key names as text strings. For example, use `"Left"` for the left arrow key, `"Space"` for the spacebar, or `"A"` for the A key.

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

## Key released (text expression)
Make sure the key name is surrounded by quotes.

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

![](/gdevelop5/all-features/annotation_2019-06-20_191302.png)
Common key name examples: `"Left"`, `"Right"`, `"Up"`, `"Down"`, `"Space"`, `"Return"`, `"Escape"`, `"Shift"`, `"Control"`, `"A"`–`"Z"`, `"F1"`–`"F12"`, `"Numpad0"`–`"Numpad9"`.

## Last key pressed
## LastPressedKey expression

"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 most recently pressed key as a string. For example, if the left arrow key was last pressed, the expression returns `"Left"`. This is useful for displaying key hints or for remapping controls.

## Reference

Expand Down
59 changes: 45 additions & 14 deletions docs/gdevelop5/all-features/window/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,69 @@ title: Window and game area
The window of the game is the area in which the game is displayed. It DOES NOT refer to the system window that includes the toolbar, title bar on the top and a frame on the other three sides.

## 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 **De/activate fullscreen** action toggles the game between fullscreen and windowed mode. When in fullscreen, the game takes up as much area as possible.

For HTML5 games, an optional **"Keep aspect ratio"** parameter controls whether the game maintains its aspect ratio when entering fullscreen (enabled by default).

Use the **"Fullscreen activated?"** condition to check whether the game is currently displayed in fullscreen — useful for toggling a fullscreen button's icon or adapting the UI.

## Window size vs. game resolution

There is an important distinction between the **game window size** (the OS window) and the **game resolution** (how many pixels the game renders):

- **Game window size** — Use the **"Game window size"** action to resize the OS window itself. This only works on desktop platforms (Windows, macOS, Linux); browsers and mobile devices ignore this action. You can choose whether the game resolution is also updated to match.
- **Game resolution** — Use the **"Game resolution"** action to change the internal rendering resolution independently from the window size. This works on all platforms. Changing only the resolution without the window size will stretch or shrink the rendered image to fit the window.

For example, to build a settings screen that lets players choose a display resolution, use the **"Game window size"** action (desktop) together with **"Game resolution"** so the content scales correctly.

## Adaptive resolution

GDevelop can automatically adapt the game resolution when the window or screen size changes, useful for responsive web games or resizable desktop windows.

- **"Game resolution resize mode"** — Controls which dimension adapts:
- `adaptWidth`: the game width is adjusted to fit the window while keeping the height.
- `adaptHeight`: the game height is adjusted to fit the window while keeping the width.
- Empty string: no automatic adaptation.
- **"Automatically adapt the game resolution"** — Enables or disables the live adaptation as the window is resized. This only takes effect when a resize mode (`adaptWidth` or `adaptHeight`) is also set.

## 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.
Notice the black borders on all four sides of the window. The width of the borders is 100px.

## Size of the window
## Center the window

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.
The **"Center the game window on the screen"** action repositions the OS window to the center of the screen. This only works on Windows, macOS, and Linux — it has no effect in browsers or on mobile.

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.
## Window icon

![](/gdevelop5/all-features/annotation_2019-06-29_175454.png)
The **"Window's icon"** action changes the icon displayed in the OS title bar and taskbar at runtime. Pass the name of an image resource already added to the project.

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.
## Window title

!!! note
The window title is the name of the window that is visible on the title bar (located at the top) of the window.

The game is cropped starting from the top-left corner of the game.
By default, the game name is used for the executable name (on Windows, macOS and Linux), the app name (on Android and iOS) and the title bar (on Windows, macOS and Linux) (and the page title for HTML5 games). You can [learn more about it in game properties.](/gdevelop5/interface/project-manager/properties)

![](/gdevelop5/all-features/annotation_2019-06-29_175540.png)
With the **"Window's title"** action, 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.

## Window title
## Expressions

The window title is the name of the window that is visible on the title bar (located at the top) of the window. The default title name is "Preview of ProjectName" during a preview.
Several expressions let you read size and title information at runtime:

By default, the game name is used for the executable name (on Windows, macOS and Linux), the app name (on Android and iOS) and the title bar (on Windows, macOS and Linux) (and the page title for HTML5 games). You can [learn more about it in game properties.](/gdevelop5/interface/project-manager/properties)
| Expression | Returns | Notes |
|---|---|---|
| `SceneWindowWidth()` | number | Width of the game's rendering canvas |
| `SceneWindowHeight()` | number | Height of the game's rendering canvas |
| `ScreenWidth()` | number | Width of the browser page or OS window |
| `ScreenHeight()` | number | Height of the browser page or OS window |
| `WindowTitle$()` | string | Current window title |
| `ColorDepth()` | number | Screen color depth in bits |

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.
`SceneWindowWidth()`/`SceneWindowHeight()` reflect the game resolution, while `ScreenWidth()`/`ScreenHeight()` reflect the full browser or OS window dimensions.

## Reference

Expand Down