From 3759383768c2f6515aabf2fa3f1c963bdc6ab695 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:33:06 +0000 Subject: [PATCH] [Auto] [Improve] Added complete keyboard key name reference with all valid names and variants --- automated_updates_data.json | 4 + docs/gdevelop5/all-features/keyboard/index.md | 78 +++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/automated_updates_data.json b/automated_updates_data.json index 1c860f773d5..509a1494736 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -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-16", + "summary": "Improved keyboard docs: added complete valid key name reference (letters, numpad, arrows, function keys, modifier keys with left/right variants, navigation, punctuation) with case-sensitivity note" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcbe..19f767300c5 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -37,6 +37,84 @@ To test a key release using this condition, you need to enter the key name in th "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". +## Valid key names + +The following key names can be used with the **Key pressed (text expression)** and **Key released (text expression)** conditions, as well as the **Last key pressed** expression. + +!!! note + + Key names are **case-sensitive**. Use exactly the names shown below (e.g. `"LShift"`, not `"lshift"`). Letter keys use **lowercase** (e.g. `"a"`, `"z"`). + +### Letters + +`a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + +### Number row + +`Num0` `Num1` `Num2` `Num3` `Num4` `Num5` `Num6` `Num7` `Num8` `Num9` + +### Numpad digits + +`Numpad0` `Numpad1` `Numpad2` `Numpad3` `Numpad4` `Numpad5` `Numpad6` `Numpad7` `Numpad8` `Numpad9` + +### Arrow keys + +`Left` `Right` `Up` `Down` + +Numpad arrow variants: `NumpadLeft` `NumpadRight` `NumpadUp` `NumpadDown` + +### Function keys + +`F1` `F2` `F3` `F4` `F5` `F6` `F7` `F8` `F9` `F10` `F11` `F12` + +### Modifier keys + +Left and right variants are distinguished so you can detect which side of the keyboard was used: + +| Left | Right | +|------|-------| +| `LShift` | `RShift` | +| `LControl` | `RControl` | +| `LAlt` | `RAlt` | +| `LSystem` | `RSystem` | + +`LSystem` / `RSystem` corresponds to the **Windows key** on Windows, the **Command (⌘) key** on macOS, and the **Super key** on Linux. + +### Whitespace and control keys + +`Space` `Tab` `Return` (Enter) `Back` (Backspace) `Escape` + +Numpad Enter: `NumpadReturn` + +### Navigation keys + +`Home` `End` `PageUp` `PageDown` `Insert` `Delete` `Pause` + +Numpad navigation variants: `NumpadHome` `NumpadEnd` `NumpadPageUp` `NumpadPageDown` + +### Arithmetic and numpad operators + +`Add` `Subtract` `Multiply` `Divide` + +Numpad-specific variants: `NumpadAdd` `NumpadSubtract` `NumpadMultiply` `NumpadDivide` + +### Punctuation and symbols + +| Name | Key | +|------|-----| +| `SemiColon` | `;` | +| `Comma` | `,` | +| `Period` | `.` | +| `Quote` | `'` | +| `Slash` | `/` | +| `BackSlash` | `\` | +| `Equal` | `=` | +| `Dash` | `-` | +| `LBracket` | `[` | +| `RBracket` | `]` | +| `Tilde` | `` ` `` | +| `Menu` | Context menu key | + ## Reference All actions, conditions and expressions are listed in [the keyboard reference page](/gdevelop5/all-features/keyboard/reference/). \ No newline at end of file