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 @@ -88,6 +88,10 @@
{
"date": "2026-04-02",
"summary": "Improved multiplayer docs: added Quick Join section, documented player username/ping/last-joined/last-left expressions, lobby ID expression, custom message variable variant, and synchronization rate action"
},
{
"date": "2026-04-13",
"summary": "Improved keyboard docs (added Key just pressed, Any key released, mobile note, valid key names table) and window docs (added IsFullScreen condition, Center window, game resolution vs window size distinction, expressions table)"
}
]
}
51 changes: 41 additions & 10 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,69 @@ title: Keyboard

GDevelop gives access to all inputs made on the keyboard. This includes conditions to check if a key was pressed or released.

!!! note

Keyboard conditions detect a **physical keyboard**. They do **not** work with on-screen keyboards on touch/mobile devices. When making a game for mobile or touchscreen devices, use the [mouse and 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.
This condition is true if any key on the keyboard is currently pressed (held down).

## Any key released

This condition is true if any key was just released during this frame.

## Key pressed

Whenever the key selected while setting this condition is pressed, the corresponding actions are performed.
Whenever the selected key is **held down**, this condition is true. It stays true for every frame the key is held. Use this for continuous actions like moving a character.

## Key just pressed

Whenever the selected key is **first pressed**, this condition is true for that **single frame only**. It becomes false on subsequent frames even if the key is still held. Use this for one-shot actions like jumping, opening a menu, or firing a bullet.

!!! tip

Use **"Key pressed"** for movement that should happen while the key is held, and **"Key just pressed"** for actions that should trigger once per key press (like jumping or firing).

## Key released

Whenever the key selected while setting this condition is released, the corresponding actions are performed.
Whenever the selected key is **just released**, this condition is true for that single frame.

## Key pressed / Key just pressed / Key released (text expression)

## Key pressed (text expression)
These conditions work the same as their counterparts above, but accept a **text expression** for the key name. This is useful when the key name is stored in a variable or determined at runtime.

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.
For example, to check if the left arrow key is pressed, 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)
![](/gdevelop5/all-features/annotation_2019-06-20_191302.png)

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.
### Valid key names

![](/gdevelop5/all-features/annotation_2019-06-20_191302.png)
The following key names are accepted by the text expression variants:

| Category | Key names |
|----------|-----------|
| Letters | `"a"` to `"z"` |
| Top-row numbers | `"Num0"` to `"Num9"` |
| Numpad digits | `"Numpad0"` to `"Numpad9"` |
| Numpad operators | `"NumpadAdd"`, `"NumpadSubtract"`, `"NumpadMultiply"`, `"NumpadDivide"`, `"NumpadReturn"` |
| Arrow keys | `"Left"`, `"Right"`, `"Up"`, `"Down"` |
| Function keys | `"F1"` to `"F12"` |
| Modifier keys | `"LShift"`, `"RShift"`, `"LControl"`, `"RControl"`, `"LAlt"`, `"RAlt"` |
| Common keys | `"Space"`, `"Return"`, `"Escape"`, `"Tab"`, `"Back"` (Backspace), `"Delete"`, `"Insert"` |
| Navigation | `"Home"`, `"End"`, `"PageUp"`, `"PageDown"` |
| Punctuation | `"SemiColon"`, `"Comma"`, `"Period"`, `"Slash"`, `"BackSlash"`, `"Quote"`, `"Equal"`, `"Dash"`, `"Tilde"` |

## 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 `LastPressedKey()` expression returns the name of the most recently pressed key as a string. For example, if the left arrow key was pressed last, the expression returns `"Left"`.

## Reference

All actions, conditions and expressions are listed in [the keyboard reference page](/gdevelop5/all-features/keyboard/reference/).
All actions, conditions and expressions are listed in [the keyboard reference page](/gdevelop5/all-features/keyboard/reference/).
33 changes: 27 additions & 6 deletions docs/gdevelop5/all-features/window/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,38 @@ 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 "Fullscreen activated?" condition checks whether the game is currently in fullscreen mode.

## 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 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 between two related but different 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 virtual canvas size the game renders at (set in **Project Properties**). It determines how much of the game world is visible and at what quality.
- **Window size** is the actual pixel size of the operating system window. This only applies to desktop (Windows, macOS, Linux) games — browsers and mobile apps manage the window themselves.

![](/gdevelop5/all-features/annotation_2019-06-29_175454.png)
Use the **"Game resolution"** action to change the virtual canvas size without affecting the window, or the **"Game window size"** action to resize the operating system window on desktop.

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.
When the window size and game resolution differ, the game is scaled (stretched or letterboxed) to fit. Choosing "Also update the game resolution: Yes" in the window size action makes both match, avoiding any scaling.

!!! note

The game is cropped starting from the top-left corner of the game.
The game is cropped starting from the top-left corner if the window is smaller than the game resolution.

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

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

## Center the window

The **"Center the game window on the screen"** action moves the application window to the center of the screen. This only works on desktop (Windows, macOS, Linux) — it has no effect in browsers or on mobile.

## Window title

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

## Expressions

| Expression | Returns |
|------------|---------|
| `SceneWindowWidth()` | Current game resolution width (virtual canvas) |
| `SceneWindowHeight()` | Current game resolution height (virtual canvas) |
| `ScreenWidth()` | Actual container/window inner width in pixels |
| `ScreenHeight()` | Actual container/window inner height in pixels |
| `WindowTitle()` | Current window title as a string |

`SceneWindowWidth()` and `SceneWindowHeight()` reflect the game resolution, which may differ from `ScreenWidth()`/`ScreenHeight()` if the window has been resized or if the game is displayed in a browser with a different page size.

## Reference

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