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 @@ -64,6 +64,10 @@
{
"date": "2026-02-24",
"summary": "Fixed custom behavior lifecycle method names (onStepPreEvents/onStepPostEvents → doStepPreEvents/doStepPostEvents) and updated collisions doc to reference Physics 2 instead of deprecated Physics behavior"
},
{
"date": "2026-02-27",
"summary": "Improved keyboard docs with mobile incompatibility warning, key-pressed vs key-just-pressed distinction, and key name reference; improved network docs with async request guide, HTTP methods, and CORS explanation"
}
]
}
41 changes: 31 additions & 10 deletions docs/gdevelop5/all-features/keyboard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,60 @@ title: Keyboard
---
# Keyboard

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

## Any key pressed
!!! warning

Keyboard conditions work only with **physical keyboards**. They do **not** work with on-screen (virtual) keyboards on touchscreen and mobile devices. If your game targets mobile or touchscreen platforms, use [mouse/touch conditions](/gdevelop5/all-features/mouse-touch) instead.

## Key pressed vs. key just pressed

For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed.
There are two distinct conditions for detecting a key being pressed:

## Key pressed
- **Key pressed** — Returns true continuously for **as long as the key is held down**. Use this for movement or actions that should repeat while the key is held (e.g., moving a character while an arrow key is held).
- **Key just pressed** — Returns true only **during the single frame when the key is first pressed**. Use this for one-shot actions such as jumping, shooting, or opening a menu.

Whenever the key selected while setting this condition is pressed, the corresponding actions are performed.
Choosing the wrong one is a common mistake: using "Key pressed" for a jump action causes the action to fire on every frame the key is held, whereas "Key just pressed" fires exactly once per key press.

## Any key pressed

Returns true if **any** key on the keyboard is currently pressed. Useful for "press any key to continue" screens.

## Key released

Whenever the key selected while setting this condition is released, the corresponding actions are performed.
Returns true during the single frame when a key is **released**.

## 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.
Lets you specify the key name as a text expression, which is useful when the key is stored in a variable or configured by the player at runtime. Enter the key name surrounded by double quotes, for example `"Left"` for the left arrow key.

Common key names:

- Arrow keys: `"Left"`, `"Right"`, `"Up"`, `"Down"`
- Letters: `"a"` through `"z"` (lowercase)
- Digit row: `"Num0"` through `"Num9"`
- Numpad digits: `"Numpad0"` through `"Numpad9"`
- Function keys: `"F1"` through `"F12"`
- Common keys: `"Space"`, `"Return"`, `"Escape"`, `"Back"` (Backspace), `"Tab"`, `"Delete"`, `"Insert"`
- Modifiers: `"LShift"`, `"RShift"`, `"LControl"`, `"RControl"`, `"LAlt"`, `"RAlt"`

!!! danger

Make sure that the key name is surrounded by quotes.
Make sure that the key name is surrounded by quotes — for example `"Space"`, not `Space`.

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

## 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.
Works the same as "Key pressed (text expression)" but triggers when the specified key is **released**.

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

This is useful for displaying the last key pressed on screen or for implementing custom key-rebinding.

## Reference

Expand Down
19 changes: 17 additions & 2 deletions docs/gdevelop5/all-features/network/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,24 @@ Games and applications work similarly to send or get data to a server:
* they send a request to a specific address (also called an endpoint). Optionally, the request can include parameters.
* the server sends back a response. The set of all requests that are handled by a server is sometimes called an API.

In addition to the address and the parameters, HTTP requests can have a "verb" associated as well. Requests to get data or fetch a webpage are usually "GET" requests. Requests to post data are usually "POST" requests.
In addition to the address and the parameters, HTTP requests have a "method" (or "verb"): "GET" requests fetch data, "POST" requests send new data, "PUT" and "PATCH" update existing data, and "DELETE" removes data. GDevelop supports the full set of HTTP methods: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, and `OPTIONS`.

GDevelop provides the action called "Send a request to a web page". You can specify the host and the path to the API/web page to be called (for example, if your "endpoint" is `https://mygame.com/api/store-score`, the host is `https://mygame.com` and the path is `/api/store-score` (don't forget the slash /)). You can also specify the content of the request (the parameter that will be received by the server).
## Sending an asynchronous request (recommended)

Use the action **"Send an async request to a web page"** to call an API without pausing the game. The game continues running while it waits for a response. You provide:

- **URL** — the full address of the endpoint, e.g. `"https://mygame.com/api/store-score"`. HTTPS is strongly recommended.
- **Body** — the content to send with the request (see formatting below).
- **Method** — the HTTP method: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, or `OPTIONS`.
- **Content type** — defaults to `application/x-www-form-urlencoded` if left empty. Use `application/json` when sending JSON data.
- **Response variable** — the scene variable that will receive the server's response text when the request succeeds.
- **Error variable** — the scene variable that will receive an error description if the request fails. It contains the HTTP status code (e.g. `"404"`) for server errors, or the special value `"REQUEST_NOT_SENT"` for connection failures such as no internet access or a CORS block.

!!! warning

**CORS for web games** — When your game runs in a browser, the browser blocks requests to a different domain unless that server explicitly allows it with CORS headers (`Access-Control-Allow-Origin`). If you see `"REQUEST_NOT_SENT"` in your error variable for a web game, check the server's CORS configuration. This restriction does not apply to desktop or mobile builds.

GDevelop also provides the older action "Send a request to a web page". You can specify the host and the path to the API/web page to be called (for example, if your "endpoint" is `https://mygame.com/api/store-score`, the host is `https://mygame.com` and the path is `/api/store-score` (don't forget the slash /)). You can also specify the content of the request (the parameter that will be received by the server).

When the server sends the response, it is saved in a variable so that you can read what was sent.

Expand Down