Key codes
Minecraft Wiki article. Categories: Upcoming, Java_Edition_upcoming_tag, Information_needed, Needs_updating, Citation_needed, Planned, Articles_to_be_expanded, Cleanup_with_a_reason…
This article is reproduced from Key codes on the Minecraft Wiki. Mirrored from revision 3725876. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.
This is a list of key codes used by Minecraft, which are used in the options.txt file.
Java Edition
Only keys which can be directly detected by the operating system are able to be bound to game controls - keys such as F Lock[1] or Fn typically are not recognisable themselves as keys, and Minecraft and all other computer programs will be oblivious to them in isolation.
Only mouse buttons can have controls be bound to them in the options menu. Mouse movement, vertical scrolling and horizontal scrolling are hardcoded, and their default actions cannot be assigned to other keys or buttons, nor can scrolling or moving the mouse be made to do anything else.
Java Edition does not provide official support for controllers.
Keyboard codes
Reason: Snapshot 9 just seems to have added every SDL3 keycode, we need to figure out what ones are unused and put them in a separate table
The displayed names of several keys will change depending on the currently active system keyboard layout. The values displayed in this table assume a standard en-US QWERTY layout. Some keys also have operating system dependent names, which are assigned different rows sharing an ID.
| ID | Displayed name | Physical key or button | Translation key[note 1] | |
|---|---|---|---|---|
key.keyboard.unknown
|
Unassigned[note 2] | key.keyboard.unknown
| ||
key.keyboard.0
|
0 | [note 3] | ||
key.keyboard.1
|
1 | [note 3] | ||
key.keyboard.2
|
2 | [note 3] | ||
key.keyboard.3
|
3 | [note 3] | ||
key.keyboard.4
|
4 | [note 3] | ||
key.keyboard.5
|
5 | [note 3] | ||
key.keyboard.6
|
6 | [note 3] | ||
key.keyboard.7
|
7 | [note 3] | ||
key.keyboard.8
|
8 | [note 3] | ||
key.keyboard.9
|
9 | [note 3] | ||
key.keyboard.a
|
A | [note 3] | ||
key.keyboard.b
|
B | [note 3] | ||
key.keyboard.c
|
C | [note 3] | ||
key.keyboard.d
|
D | [note 3] | ||
key.keyboard.e
|
E | [note 3] | ||
key.keyboard.f
|
F | [note 3] | ||
key.keyboard.g
|
G | [note 3] | ||
key.keyboard.h
|
H | [note 3] | ||
key.keyboard.i
|
I | [note 3] | ||
key.keyboard.j
|
J | [note 3] | ||
key.keyboard.k
|
K | [note 3] | ||
key.keyboard.l
|
L | [note 3] | ||
key.keyboard.m
|
M | [note 3] | ||
key.keyboard.n
|
N | [note 3] | ||
key.keyboard.o
|
O | [note 3] | ||
key.keyboard.p
|
P | [note 3] | ||
key.keyboard.q
|
Q | [note 3] | ||
key.keyboard.r
|
R | [note 3] | ||
key.keyboard.s
|
S | [note 3] | ||
key.keyboard.t
|
T | [note 3] | ||
key.keyboard.u
|
U | [note 3] | ||
key.keyboard.v
|
V | [note 3] | ||
key.keyboard.w
|
W | [note 3] | ||
key.keyboard.x
|
X | [note 3] | ||
key.keyboard.y
|
Y | [note 3] | ||
key.keyboard.z
|
Z | [note 3] | ||
key.keyboard.space
|
␣ Space | key.keyboard.space
| ||
key.keyboard.tab
|
↹ Tab | key.keyboard.tab
| ||
key.keyboard.apostrophe
|
' | key.keyboard.apostrophe[note 4]
| ||
key.keyboard.backslash
|
\ (ANSI) | key.keyboard.backslash[note 4]
| ||
key.keyboard.comma
|
, | key.keyboard.comma[note 4]
| ||
key.keyboard.equal
|
= | key.keyboard.equal[note 4]
| ||
key.keyboard.grave.accent
|
` | key.keyboard.grave.accent[note 4]
| ||
key.keyboard.left.bracket
|
[ | key.keyboard.left.bracket[note 4]
| ||
key.keyboard.minus
|
- | key.keyboard.minus[note 4]
| ||
key.keyboard.period
|
. | key.keyboard.period[note 4]
| ||
key.keyboard.right.bracket
|
] | key.keyboard.right.bracket[note 4]
| ||
key.keyboard.semicolon
|
; | key.keyboard.semicolon[note 4]
| ||
key.keyboard.slash
|
/ | key.keyboard.slash[note 4]
| ||
key.keyboard.world.1
|
[until: JE 26.3][note 5] [upcoming: JE 26.3] |
Varies[note 6][until: JE 26.3] \ (ISO)[upcoming: JE 26.3] |
key.keyboard.world.1[note 7]
| |
key.keyboard.world.2
|
[until: JE 26.3] [upcoming: JE 26.3] |
Varies[note 8][until: JE 26.3] Cannot be assigned[upcoming: JE 26.3] |
key.keyboard.world.2[note 7]
| |
key.keyboard.f1
|
F1 | key.keyboard.f1
| ||
key.keyboard.f2
|
F2 | key.keyboard.f2
| ||
key.keyboard.f3
|
F3 | key.keyboard.f3
| ||
key.keyboard.f4
|
F4 | key.keyboard.f4
| ||
key.keyboard.f5
|
F5 | key.keyboard.f5
| ||
key.keyboard.f6
|
F6 | key.keyboard.f6
| ||
key.keyboard.f7
|
F7 | key.keyboard.f7
| ||
key.keyboard.f8
|
F8 | key.keyboard.f8
| ||
key.keyboard.f9
|
F9 | key.keyboard.f9
| ||
key.keyboard.f10
|
F10 | key.keyboard.f10
| ||
key.keyboard.f11
|
F11 | key.keyboard.f11
| ||
key.keyboard.f12
|
F12 | key.keyboard.f12
| ||
key.keyboard.f13
|
F13[note 9] | key.keyboard.f13
| ||
key.keyboard.f14
|
F14 | key.keyboard.f14
| ||
key.keyboard.f15
|
F15 | key.keyboard.f15
| ||
key.keyboard.f16
|
F16 | key.keyboard.f16
| ||
key.keyboard.f17
|
F17 | key.keyboard.f17
| ||
key.keyboard.f18
|
F18 | key.keyboard.f18
| ||
key.keyboard.f19
|
F19 | key.keyboard.f19
| ||
key.keyboard.f20
|
F20 | key.keyboard.f20
| ||
key.keyboard.f21
|
F21 | key.keyboard.f21
| ||
key.keyboard.f22
|
F22 | key.keyboard.f22
| ||
key.keyboard.f23
|
F23 | key.keyboard.f23
| ||
key.keyboard.f24
|
F24 | key.keyboard.f24
| ||
key.keyboard.f25[until: JE 26.3]
|
Unclear[note 10] | key.keyboard.f25[until: JE 26.3]
| ||
key.keyboard.keypad.0
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 0 | key.keyboard.keypad.0[note 11]
| |
key.keyboard.keypad.1
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 1 | key.keyboard.keypad.1[note 11]
| |
key.keyboard.keypad.2
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 2 | key.keyboard.keypad.2[note 11]
| |
key.keyboard.keypad.3
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 3 | key.keyboard.keypad.3[note 11]
| |
key.keyboard.keypad.4
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 4 | key.keyboard.keypad.4[note 11]
| |
key.keyboard.keypad.5
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 5 | key.keyboard.keypad.5[note 11]
| |
key.keyboard.keypad.6
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 6 | key.keyboard.keypad.6[note 11]
| |
key.keyboard.keypad.7
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 7 | key.keyboard.keypad.7[note 11]
| |
key.keyboard.keypad.8
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 8 | key.keyboard.keypad.8[note 11]
| |
key.keyboard.keypad.9
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad 9 | key.keyboard.keypad.9[note 11]
| |
key.keyboard.keypad.add
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad + | key.keyboard.keypad.add[note 11]
| |
key.keyboard.keypad.subtract
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad - | key.keyboard.keypad.subtract[note 11]
| |
key.keyboard.keypad.multiply
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad * | key.keyboard.keypad.multiply[note 11]
| |
key.keyboard.keypad.divide
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad / | key.keyboard.keypad.divide[note 11]
| |
key.keyboard.keypad.equal
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad = | key.keyboard.keypad.equal[note 11]
| |
key.keyboard.keypad.plus.minus[upcoming: JE 26.3]
|
Numpad ± | key.keyboard.keypad.plus.minus
| ||
key.keyboard.keypad.left.parenthesis[upcoming: JE 26.3]
|
Numpad ( | key.keyboard.keypad.left.parenthesis
| ||
key.keyboard.keypad.right.parenthesis[upcoming: JE 26.3]
|
Numpad ) | key.keyboard.keypad.right.parenthesis
| ||
key.keyboard.keypad.decimal
|
[until: JE 26.3] [upcoming: JE 26.3] |
Numpad .[until: JE 26.3] Cannot be assigned[upcoming: JE 26.3] |
key.keyboard.keypad.decimal[note 11]
| |
key.keyboard.keypad.period[upcoming: JE 26.3]
|
Numpad .[3] | key.keyboard.keypad.period
| ||
key.keyboard.keypad.comma[upcoming: JE 26.3]
|
Numpad ,[note 12] | key.keyboard.keypad.comma
| ||
key.keyboard.keypad.enter
|
⎆ Numpad Enter | key.keyboard.keypad.enter
| ||
key.keyboard.menu
|
≣ Menu[until: JE 26.3] | key.keyboard.menu
| ||
key.keyboard.application[upcoming: JE 26.3]
|
≣ Menu | key.keyboard.application
| ||
key.keyboard.num.lock
|
Num Lock | key.keyboard.num.lock
| ||
key.keyboard.caps.lock
|
⇪ Caps Lock | key.keyboard.caps.lock
| ||
key.keyboard.scroll.lock
|
⤓ Scroll Lock | key.keyboard.scroll.lock
| ||
key.keyboard.delete
|
⌦ Delete | key.keyboard.delete
| ||
key.keyboard.insert
|
⎀ Insert | key.keyboard.insert
| ||
key.keyboard.home
|
⇱ Home | key.keyboard.home
| ||
key.keyboard.end
|
⇲ End | key.keyboard.end
| ||
key.keyboard.print.screen
|
⎙ Print Screen / System Request | key.keyboard.print.screen
| ||
key.keyboard.pause
|
Pause / ⎊ Break | key.keyboard.pause
| ||
key.keyboard.page.up
|
⇞ Page Up | key.keyboard.page.up
| ||
key.keyboard.page.down
|
⇟ Page Down | key.keyboard.page.down
| ||
key.keyboard.up
|
↑ Up | key.keyboard.up
| ||
key.keyboard.left
|
← Left | key.keyboard.left
| ||
key.keyboard.right
|
→ Right | key.keyboard.right
| ||
key.keyboard.down
|
↓ Down | key.keyboard.down
| ||
key.keyboard.escape
|
Cannot be assigned[note 13] | key.keyboard.escape
| ||
key.keyboard.enter
|
⏎ Return | key.keyboard.enter
| ||
key.keyboard.backspace
|
⌫ Backspace | key.keyboard.backspace
| ||
key.keyboard.left.shift
|
⇧ Left Shift | key.keyboard.left.shift
| ||
key.keyboard.right.shift
|
⇧ Right Shift | key.keyboard.right.shift
| ||
key.keyboard.left.control
|
⎈ Left Control | key.keyboard.left.control
| ||
key.keyboard.right.control
|
⎈ Right Control | key.keyboard.right.control
| ||
key.keyboard.left.alt
|
Windows Linux |
⌥ Left Alt | key.keyboard.left.alt
| |
| [upcoming: JE 26.3] | macOS | ⌥ Left Option | key.keyboard.left.option[upcoming: JE 26.3]
| |
key.keyboard.right.alt
|
[4] | Windows Linux |
⌥ Right Alt | key.keyboard.right.alt
|
| [upcoming: JE 26.3] | macOS | ⌥ Right Option | key.keyboard.right.option[upcoming: JE 26.3]
| |
key.keyboard.left.win
|
[until: JE 26.3] [upcoming: JE 26.3] |
Windows | ⊞ Left Windows | key.keyboard.left.win[until: JE 26.3]key.keyboard.left.windows[upcoming: JE 26.3]
|
| [upcoming: JE 26.3] | macOS | ⌘ Left Command | key.keyboard.left.command[upcoming: JE 26.3]
| |
| [upcoming: JE 26.3] | Linux | ◆ Left Meta | key.keyboard.left.meta[upcoming: JE 26.3]
| |
key.keyboard.right.win
|
[until: JE 26.3] [upcoming: JE 26.3] |
Windows | ⊞ Right Windows | key.keyboard.right.win[until: JE 26.3]key.keyboard.right.windows[upcoming: JE 26.3]
|
| [upcoming: JE 26.3] | macOS | ⌘ Right Command | key.keyboard.right.command[upcoming: JE 26.3]
| |
| [upcoming: JE 26.3] | Linux | ◆ Right Meta | key.keyboard.right.meta[upcoming: JE 26.3]
| |
key.keyboard.mute[upcoming: JE 26.3]
|
🔇︎ Mute | key.keyboard.mute
| ||
key.keyboard.volume.down[upcoming: JE 26.3]
|
🔉︎ Volume Down | key.keyboard.volume.down
| ||
key.keyboard.volume.up[upcoming: JE 26.3]
|
🔊︎ Volume Up | key.keyboard.volume.up
| ||
key.keyboard.media.play.pause[upcoming: JE 26.3]
|
⏯︎ Play/Pause | key.keyboard.media.play.pause
| ||
key.keyboard.stop[upcoming: JE 26.3]
|
Stop | key.keyboard.stop
| ||
key.keyboard.cut[upcoming: JE 26.3]
|
Cut | key.keyboard.cut
| ||
key.keyboard.copy[upcoming: JE 26.3]
|
Copy | key.keyboard.copy
| ||
key.keyboard.paste[upcoming: JE 26.3]
|
Paste | key.keyboard.paste
| ||
key.keyboard.undo[upcoming: JE 26.3]
|
⎌ Undo | key.keyboard.undo
| ||
key.keyboard.again[upcoming: JE 26.3]
|
Redo[5] | key.keyboard.again
| ||
key.keyboard.ac.new[upcoming: JE 26.3]
|
📄 New | key.keyboard.ac.new
| ||
key.keyboard.ac.save[upcoming: JE 26.3]
|
💾 Save | key.keyboard.ac.save
| ||
key.keyboard.help[upcoming: JE 26.3]
|
Help | key.keyboard.help
| ||
key.keyboard.find[upcoming: JE 26.3]
|
Find | key.keyboard.find
| ||
scancode.[note 14][until: JE 26.3]
|
[note 14] | Keys with no assigned ID | scancode.[note 14]
| |
key.keyboard.[note 15][upcoming: JE 26.3]
|
[note 15] | Keys with no assigned ID | key.keyboard.[note 15]
| |
Without names
SDL3 maintains its own internal numbering system, meaning that these match from one operating system to the other, unlike what was the case with GLFW.[upcoming: JE 26.3]
While any number can be placed after key.keyboard.[note 16], only those which can actually be accessed via a key press binding in-game are listed. Many are automatically converted to proper key IDs at runtime.
The keys listed here are mostly comprised of buttons exclusive to Japanese, Korean and Brazilian keyboard layouts, as well as buttons on multimedia keyboards.
| Displayed name | Physical key or button | Ticket |
|---|---|---|
| ⏻ Power | MC-310991 | |
| ろ (JIS) / / (ABNT) | MC-310944 | |
| Katakana/Hiragana | MC-310944 | |
| ¥ | MC-310944 | |
| 変換 Henkan | MC-310944 | |
| 無変換 Muhenkan | MC-310944 | |
| 한⁄영 Han/Yeong | MC-310944 | |
| 한자 Hanja | MC-310944 | |
| Katakana | MC-310944 | |
| Hiragana | MC-310944 | |
| Cancel | MC-311035 | |
| 全角⁄半角 Halfwidth/Fullwidth | MC-310984 | |
| ⏾ Sleep | MC-310991 | |
| Wake | MC-310991 | |
| ▶︎ Play | MC-310116 | |
| ⏸︎ Pause | MC-310116 | |
| ⏺︎ Record | MC-310116 | |
| ⏩︎ Fast Forward | MC-310116 | |
| ⏪︎ Rewind | MC-310116 | |
| ⏭︎ Next Track | MC-310116 | |
| ⏮︎ Previous Track | MC-310116 | |
| ⏹︎ Stop | MC-310116 | |
| ⏏︎ Eject | MC-310116 | |
| Media Select | MC-310116 | |
| 📂 Open | MC-311010 | |
| Application Close | MC-311010 | |
| Application Exit | MC-311010 | |
| Application Properties | MC-311010 | |
| 🔍︎ Search | MC-311010 | |
| ⌂ Home | MC-311010 | |
| ⬅︎ Back | MC-311010 | |
| ➡︎ Forward | MC-311010 | |
| 🔄︎ Refresh | MC-311010 | |
| Application Bookmarks | MC-311010 |
Mouse codes
Mouse buttons are handled as a signed 32-bit integer, meaning that through editing options.txt, values from key.mouse.-2147483648 to key.mouse.2147483647 can be specified without being rejected by the game as invalid.[6] However, the USB HID specification only permits mouse buttons from 1 to 65535,[7] meaning that all negative values and the vast majority of the positive values can never actually be assigned to in-game actions without file editing.
Only the first eight mouse buttons can have controls assigned to them.[until: JE 26.3]
On Linux, mouse buttons up to 48[upcoming: JE 26.3] can be specified (evdev key press events 272 to 319) - it is not known if any supported operating systems support a 49th or higher mouse button as input. The maximum mouse button on macOS is 32,[8] and the maximum mouse button on Windows is 5.
For the first three mouse buttons, the translation keys match the key IDs; all other buttons follow a generic template.
| ID | Displayed name | Description | Usable on | ||
|---|---|---|---|---|---|
| Windows | macOS | Linux | |||
key.mouse.left[note 17]
|
Yes | Yes | Yes | ||
key.mouse.right[note 18]
|
Yes | Yes | Yes | ||
key.mouse.middle[note 19]
|
Yes | Yes | Yes | ||
key.mouse.4
|
Yes | Yes | Yes | ||
key.mouse.5
|
Yes | Yes | Yes | ||
key.mouse.6
|
No | Yes | Yes | ||
key.mouse.7
|
No | Yes | Yes | ||
key.mouse.8
|
No | Yes | Yes | ||
key.mouse.9
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.10
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.11
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.12
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.13
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.14
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.15
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.16
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.17
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.18
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.19
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.20
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.21
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.22
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.23
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.24
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.25
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.26
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.27
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.28
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.29
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.30
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.31
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.32
|
No | Yes[upcoming: JE 26.3] | Yes[upcoming: JE 26.3] | ||
key.mouse.33
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.34
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.35
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.36
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.37
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.38
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.39
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.40
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.41
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.42
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.43
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.44
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.45
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.46
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.47
|
No | No | Yes[upcoming: JE 26.3] | ||
key.mouse.48
|
No | No | Yes[upcoming: JE 26.3] | ||
Bedrock Edition
Keyboard codes
Reason: for differing operating systems (e.g. things involving the command key), implement something similar to what is seen with the Java Edition keyboard table above: make the key ID span multiple rows (rowspan 2), and have sub-rows per operating system
In Bedrock Edition, keys are stored as the decimal representation of their virtual key code.
Some numbers are skipped because they are reserved or not assigned. By modifying options.txt, you can force the game to show these numbers (prefixed with "Button"), but they are unobtainable by pressing a key.
The virtual key code specification also provides numbers for buttons on the mouse. However, mouse buttons are not stored as those numbers.
| ID | Displayed name | Physical key or button | Translation key |
|---|---|---|---|
0
|
Not Bound | [more information needed] | |
3
|
[note 20] | Pause / ⎊ Break | |
8
|
⌫ Backspace | keyboard.keyName.backspace
| |
9
|
↹ Tab | keyboard.keyName.tab
| |
12
|
Clear | ||
13
|
⏎ Return | keyboard.keyName.return
| |
16
|
⇧ Left Shift / ⇧ Right Shift | keyboard.keyName.lshift
| |
17
|
⎈ Left Control / ⎈ Right Control | keyboard.keyName.control
| |
18
|
⌥ Left Alt / ⌥ Right Alt | keyboard.keyName.alt
| |
19
|
Pause / ⎊ Break | keyboard.keyName.pause
| |
20
|
⇪ Caps Lock | keyboard.keyName.capsLock
| |
21
|
IME Kana[more information needed] / 한⁄영 Han/Yeong | ||
22
|
IME on | ||
23
|
IME Junja | ||
24
|
IME final mode | ||
25
|
한자 Hanja / IME Kanji | ||
26
|
IME off | ||
27
|
Cannot be assigned[note 21] | keyboard.keyName.escape
| |
28
|
変換 Henkan | ||
29
|
無変換 Muhenkan | ||
30
|
IME accept | ||
31
|
IME mode change request | ||
32
|
␣ Space | keyboard.keyName.space
| |
33
|
⇞ Page Up | keyboard.keyName.pgUp
| |
34
|
⇟ Page Down | keyboard.keyName.pgDown
| |
35
|
⇲ End | keyboard.keyName.end
| |
36
|
⇱ Home | keyboard.keyName.home
| |
37
|
← Left | keyboard.keyName.left
| |
38
|
↑ Up | keyboard.keyName.up
| |
39
|
→ Right | keyboard.keyName.right
| |
40
|
↓ Down | keyboard.keyName.down
| |
41
|
Select | ||
42
|
|||
43
|
Execute | ||
44
|
⎙ Print Screen / System Request | ||
45
|
⎀ Insert | keyboard.keyName.insert
| |
46
|
⌦ Delete | keyboard.keyName.delete
| |
47
|
Help | ||
48
|
0 | keyboard.keyName.0
| |
49
|
1 | keyboard.keyName.1
| |
50
|
2 | keyboard.keyName.2
| |
51
|
3 | keyboard.keyName.3
| |
52
|
4 | keyboard.keyName.4
| |
53
|
5 | keyboard.keyName.5
| |
54
|
6 | keyboard.keyName.6
| |
55
|
7 | keyboard.keyName.7
| |
56
|
8 | keyboard.keyName.8
| |
57
|
9 | keyboard.keyName.9
| |
65
|
A | keyboard.keyName.a
| |
66
|
B | keyboard.keyName.b
| |
67
|
C | keyboard.keyName.c
| |
68
|
D | keyboard.keyName.d
| |
69
|
E | keyboard.keyName.e
| |
70
|
F | keyboard.keyName.f
| |
71
|
G | keyboard.keyName.g
| |
72
|
H | keyboard.keyName.h
| |
73
|
I | keyboard.keyName.i
| |
74
|
J | keyboard.keyName.j
| |
75
|
K | keyboard.keyName.k
| |
76
|
L | keyboard.keyName.l
| |
77
|
M | keyboard.keyName.m
| |
78
|
N | keyboard.keyName.n
| |
79
|
O | keyboard.keyName.o
| |
80
|
P | keyboard.keyName.p
| |
81
|
Q | keyboard.keyName.q
| |
82
|
R | keyboard.keyName.r
| |
83
|
S | keyboard.keyName.s
| |
84
|
T | keyboard.keyName.t
| |
85
|
U | keyboard.keyName.u
| |
86
|
V | keyboard.keyName.v
| |
87
|
W | keyboard.keyName.w
| |
88
|
X | keyboard.keyName.x
| |
89
|
Y | keyboard.keyName.y
| |
90
|
Z | keyboard.keyName.z
| |
91
|
⊞ Left Windows / ⌘ Left Command / Chromebook Search | ||
92
|
⊞ Right Windows / ⌘ Right Command | ||
93
|
≣ Menu | ||
95
|
⏾ Sleep | ||
96
|
Numpad 0 | keyboard.keyName.numpad0
| |
97
|
Numpad 1 | keyboard.keyName.numpad1
| |
98
|
Numpad 2 | keyboard.keyName.numpad2
| |
99
|
Numpad 3 | keyboard.keyName.numpad3
| |
100
|
Numpad 4 | keyboard.keyName.numpad4
| |
101
|
Numpad 5 | keyboard.keyName.numpad5
| |
102
|
Numpad 6 | keyboard.keyName.numpad6
| |
103
|
Numpad 7 | keyboard.keyName.numpad7
| |
104
|
Numpad 8 | keyboard.keyName.numpad8
| |
105
|
Numpad 9 | keyboard.keyName.numpad9
| |
106
|
Numpad * | keyboard.keyName.multiply
| |
107
|
Numpad + | keyboard.keyName.add
| |
108
|
Separator | ||
109
|
Numpad - | keyboard.keyName.subtract
| |
110
|
Numpad . | keyboard.keyName.decimal
| |
111
|
Numpad / | keyboard.keyName.divide
| |
112
|
F1 | keyboard.keyName.f1
| |
113
|
F2 | keyboard.keyName.f2
| |
114
|
F3 | keyboard.keyName.f3
| |
115
|
F4 | keyboard.keyName.f4
| |
116
|
F5 | keyboard.keyName.f5
| |
117
|
F6 | keyboard.keyName.f6
| |
118
|
F7 | keyboard.keyName.f7
| |
119
|
F8 | keyboard.keyName.f8
| |
120
|
F9 | keyboard.keyName.f9
| |
121
|
F10 | keyboard.keyName.f10
| |
122
|
F11 | keyboard.keyName.f11
| |
123
|
F12 | keyboard.keyName.f12
| |
124
|
F13 | keyboard.keyName.f13
| |
125
|
F14 | ||
126
|
F15 | ||
127
|
F16 | ||
128
|
F17 | ||
129
|
F18 | ||
130
|
F19 | ||
131
|
F20 | ||
132
|
F21 | ||
133
|
F22 | ||
134
|
F23 | ||
135
|
F24 | ||
144
|
Num Lock | keyboard.keyName.numLock
| |
145
|
⤓ Scroll Lock | keyboard.keyName.scroll
| |
146
|
OEM-Specific[note 22] | ||
147
|
OEM-Specific[note 22] | ||
148
|
OEM-Specific[note 22] | ||
149
|
OEM-Specific[note 22] | ||
150
|
OEM-Specific[note 22] | ||
166
|
Browser Back | ||
167
|
Browser Forward | ||
168
|
Browser Refresh | ||
169
|
Browser Stop | ||
170
|
Browser Search | ||
171
|
Browser Favorites | ||
172
|
Browser Start and Home | ||
173
|
🔇︎ Mute | ||
174
|
🔉︎ Volume Down | ||
175
|
🔊︎ Volume Up | ||
176
|
⏭︎ Next Track | ||
177
|
⏮︎ Previous Track | ||
178
|
⏹︎ Stop | ||
179
|
⏯︎ Play/Pause | ||
180
|
Start Mail | ||
181
|
Media Select | ||
182
|
Start Application 1 | ||
183
|
Start Application 2 | ||
186
|
; | keyboard.keyName.semicolon
| |
187
|
= | keyboard.keyName.equals
| |
188
|
, | keyboard.keyName.comma
| |
189
|
- | keyboard.keyName.minus
| |
190
|
. | keyboard.keyName.period
| |
191
|
/ | keyboard.keyName.slash
| |
192
|
` | keyboard.keyName.grave
| |
219
|
[ | keyboard.keyName.lbracket
| |
220
|
\[more information needed] | keyboard.keyName.backslash
| |
221
|
] | keyboard.keyName.rbracket
| |
222
|
' | keyboard.keyName.apostrophe
| |
223
|
OEM-Specific[note 22] | ||
225
|
OEM-Specific[note 22] | ||
226
|
OEM-Specific[note 22] | ||
227
|
OEM-Specific[note 22] | ||
228
|
OEM-Specific[note 22] | ||
229
|
IME process | ||
230
|
OEM-Specific[note 22] | ||
231
|
[more information needed] | ||
233
|
OEM-Specific[note 22] | ||
234
|
OEM-Specific[note 22] | ||
235
|
OEM-Specific[note 22] | ||
236
|
OEM-Specific[note 22] | ||
237
|
OEM-Specific[note 22] | ||
238
|
OEM-Specific[note 22] | ||
239
|
OEM-Specific[note 22] | ||
240
|
OEM-Specific[note 22] | ||
241
|
OEM-Specific[note 22] | ||
242
|
OEM-Specific[note 22] | ||
243
|
OEM-Specific[note 22] | ||
244
|
OEM-Specific[note 22] | ||
245
|
OEM-Specific[note 22] | ||
246
|
Attn | ||
247
|
CrSel | ||
248
|
ExSel | ||
249
|
Erase EOF | ||
250
|
Play | ||
251
|
Zoom | ||
253
|
PA1 | ||
254
|
Clear |
Mouse codes
Mouse buttons are represented by negative numbers.
| ID | Displayed name | Description |
|---|---|---|
-99
|
||
-98
|
||
-97
|
||
-95
|
||
-94
|
Controller codes
History
Java Edition
| Java Edition Classic | |||||||
|---|---|---|---|---|---|---|---|
| 0.0.23a | Controls can now be customized. Only keyboard buttons are recognised as valid for rebinding. | ||||||
| Java Edition Beta | |||||||
| 1.8 | Pre-release | Controls can now be bound to mouse buttons; these are handled using negative numbers. | |||||
| Java Edition | |||||||
| 1.12 | 17w16a | The first three mouse buttons are now displayed as "Left Click", "Right Click" and "Middle Click". | |||||
| 1.13 | 17w43a | With the updating of LWJGL from 2 to 3 key codes have been entirely redone. For the old values, see Java Edition pre-flattening data values#Key codes, and for what each of them was converted to, see Java Edition Flattening#Key codes. | |||||
| The display names of key codes now describes the actual key (e.g. BACKSLASH changed to \). | |||||||
| The first three mouse buttons are now displayed as "Left Button", "Right Button" and "Middle Button". | |||||||
| Controls that are not bound to anything now display "Not bound". | |||||||
| The game now uses GLFW. | |||||||
| Added translation keys for most key codes, which are only displayed for keys GLFW doesn't return a name for. | |||||||
| 17w45a | Keyboard key codes and their translation keys are now prefixed with key.keyboard..
| ||||||
key.keyboard.-1 is now used for controls that are not bound to anything. | |||||||
| 17w49a | key.keyboard.unknown is now used for controls that are not bound to anything. | ||||||
| pre4 | Keypad keys, excluding the enter key, are no longer prefixed with "Num " - many now look identical to other keys despite being different. | ||||||
| Letter keys are now displayed in lowercase. | |||||||
| Controls that are not bound to anything now leave the button blank. | |||||||
| 1.19 | 22w16a | Controls that are not bound to anything now display "Not bound". | |||||
| 1.20 | pre2 | Letter keys are now displayed in uppercase again. | |||||
| pre3 | Controls that are not bound to anything now display "Not Bound". | ||||||
| Upcoming Java Edition | |||||||
| 26.3 | snap4 | Valid but undefined key codes have been changed from scancode.### to key.keyboard.###.
| |||||
Removed key.keyboard.f25.
| |||||||
| Keypad keys are now prefixed with "Keypad ". | |||||||
| Keys are only displayed as the internal name that SDL provides if that name is one character long and uses the translation key otherwise. | |||||||
| Certain keys, such as keypad plus-or-minus, keypad opening bracket and keypad closing bracket, now display the character they represent, despite not being defined key codes in the game.[9] | |||||||
| The game now uses SDL3. | |||||||
The international backslash key is now recognised as key.keyboard.world.1 on Windows, rather than key.keyboard.world.2. | |||||||
| snap7 | Several new translatable key codes have been added:
| ||||||
key.keyboard.left.alt, key.keyboard.right.alt, key.keyboard.left.win, and key.keyboard.right.win now have different display names depending on the user's operating system.[more information needed] | |||||||
| snap9 | Translatable key codes have been added for all SDL scancodes:
| ||||||
key.keyboard.application now displays as "Application".
| |||||||
key.keyboard.left.win and key.keyboard.right.win now display as "Left Windows" and "Right Windows" on Windows, respectively.
| |||||||
key.keyboard.left.win and key.keyboard.right.win now use the key.keyboard.left.meta and key.keyboard.right.meta translation keys on Linux, respectively.
| |||||||
key.keyboard.new renamed to key.keyboard.ac.new[verify]
| |||||||
key.keyboard.save renamed to key.keyboard.ac.save[verify] | |||||||
Removed keys
transfer F25 here when 26.3 comes out
Notes
- ↑ If GLFW returns an internal name, Minecraft will display that name regardless of whether there exists a translation key.[until: JE 26.3]
If the internal name of the key code from SDL is a single character, Minecraft will display that character regardless of whether there exists a translation key.[upcoming: JE 26.3] - ↑ Also used by keys unrecognised by SDL3, see MC-310108[upcoming: JE 26.3]
- ↑ 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 aa ab ac ad ae af ag ah ai aj No translation key exists and the internal name from GLFW[until: JE 26.3] or SDL[upcoming: JE 26.3] is displayed instead.
- ↑ a b c d e f g h i j k This translation key is unused.[until: JE 26.3]
This translation key is typically unused, but may be used with certain keyboard layouts or operating systems.[upcoming: JE 26.3] - ↑ device dependent; this appears on Windows, but it appears as \ on Linux
- ↑ This appears to be what the international backslash key maps to in Linux, and what the ±/§ key maps to in macOS.[2] Windows instead uses World 2 for this purpose.
- ↑ a b This translation key could be used with certain keyboard layouts or operating systems.
- ↑ From 1.13 to 26.2, the international backslash key maps to this on Windows. This no longer appears to be the case as of 26.3, where it uses World 1.
- ↑ The "Settings" key also maps to this on Linux, for some reason: MC-310119
- ↑ Ostensibly for a twenty-fifth function key, but Windows, Linux and presumably macOS only recognise up to F24. Some keyboards from decades past go past F24, and Arch Linux can apparently recognise up to F246, however it is unknown if Minecraft would recognise either of these.
- ↑ a b c d e f g h i j k l m n o p This translation key is unused.[until: JE 26.3]
- ↑ Appears to instead be interpreted as the keypad decimal point key on Linux: MC-310845
- ↑ Trying to bind anything to the Escape key causes it to become Not Bound instead. This can only be set by modifying options.txt.
- ↑ a b c Two or three digit number representing operating system key ID
- ↑ a b c Three digit number representing SDL3 key ID
- ↑ Single-digit numbers must be prefixed with a 0 (e.g.
key.keyboard.04) to use the correct key. If the 0 is omitted, it will be treated as its numerical value, because those are the key codes for the numbers. - ↑
key.mouse.1is automatically converted to this[more information needed] - ↑
key.mouse.3is automatically converted to this - ↑
key.mouse.2is automatically converted to this - ↑ Displayed the same as the middle mouse button.
- ↑ Trying to bind anything to the Escape key causes it to become Unassigned instead. This can only be set by modifying options.txt.
- ↑ a b c d e f g h i j k l m n o p q r s t u v w x The manufacturer of your keyboard can map a physical key to this key code.
References
- ↑ MC-265854
- ↑ https://github.com/glfw/glfw/issues/2481
- ↑ MC-310826
- ↑ MC-266253
- ↑ MC-310863
- ↑ MC-268286
- ↑ https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
- ↑ according to what karabiner-elements allows: https://discord.com/channels/647810384031645728/648555495564509184/1528136787434930358
- ↑ MC-310109, MC-310110
Navigation
Sources
- Key codes — Minecraft Wiki, CC BY-NC-SA 3.0, revision 3725876.