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…

📌 Mirrored from Minecraft Wiki

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

This article needs to be updated.
 
Please update this article to reflect recent updates or newly available information. The talk page may contain suggestions.
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 Not Bound Unassigned[note 2] key.keyboard.unknown
key.keyboard.0 0 0 [note 3]
key.keyboard.1 1 1 [note 3]
key.keyboard.2 2 2 [note 3]
key.keyboard.3 3 3 [note 3]
key.keyboard.4 4 4 [note 3]
key.keyboard.5 5 5 [note 3]
key.keyboard.6 6 6 [note 3]
key.keyboard.7 7 7 [note 3]
key.keyboard.8 8 8 [note 3]
key.keyboard.9 9 9 [note 3]
key.keyboard.a A A [note 3]
key.keyboard.b B B [note 3]
key.keyboard.c C C [note 3]
key.keyboard.d D D [note 3]
key.keyboard.e E E [note 3]
key.keyboard.f F F [note 3]
key.keyboard.g G G [note 3]
key.keyboard.h H H [note 3]
key.keyboard.i I I [note 3]
key.keyboard.j J J [note 3]
key.keyboard.k K K [note 3]
key.keyboard.l L L [note 3]
key.keyboard.m M M [note 3]
key.keyboard.n N N [note 3]
key.keyboard.o O O [note 3]
key.keyboard.p P P [note 3]
key.keyboard.q Q Q [note 3]
key.keyboard.r R R [note 3]
key.keyboard.s S S [note 3]
key.keyboard.t T T [note 3]
key.keyboard.u U U [note 3]
key.keyboard.v V V [note 3]
key.keyboard.w W W [note 3]
key.keyboard.x X X [note 3]
key.keyboard.y Y Y [note 3]
key.keyboard.z Z Z [note 3]
key.keyboard.space Space ␣ Space key.keyboard.space
key.keyboard.tab 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 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 F1 key.keyboard.f1
key.keyboard.f2 F2 F2 key.keyboard.f2
key.keyboard.f3 F3 F3 key.keyboard.f3
key.keyboard.f4 F4 F4 key.keyboard.f4
key.keyboard.f5 F5 F5 key.keyboard.f5
key.keyboard.f6 F6 F6 key.keyboard.f6
key.keyboard.f7 F7 F7 key.keyboard.f7
key.keyboard.f8 F8 F8 key.keyboard.f8
key.keyboard.f9 F9 F9 key.keyboard.f9
key.keyboard.f10 F10 F10 key.keyboard.f10
key.keyboard.f11 F11 F11 key.keyboard.f11
key.keyboard.f12 F12 F12 key.keyboard.f12
key.keyboard.f13 F13 F13[note 9] key.keyboard.f13
key.keyboard.f14 F14 F14 key.keyboard.f14
key.keyboard.f15 F15 F15 key.keyboard.f15
key.keyboard.f16 F16 F16 key.keyboard.f16
key.keyboard.f17 F17 F17 key.keyboard.f17
key.keyboard.f18 F18 F18 key.keyboard.f18
key.keyboard.f19 F19 F19 key.keyboard.f19
key.keyboard.f20 F20 F20 key.keyboard.f20
key.keyboard.f21 F21 F21 key.keyboard.f21
key.keyboard.f22 F22 F22 key.keyboard.f22
key.keyboard.f23 F23 F23 key.keyboard.f23
key.keyboard.f24 F24 F24 key.keyboard.f24
key.keyboard.f25​[until: JE 26.3] F25 Unclear[note 10] key.keyboard.f25​[until: JE 26.3]
key.keyboard.keypad.0 0​[until: JE 26.3]
Keypad 0​[upcoming: JE 26.3]
Numpad 0 key.keyboard.keypad.0[note 11]
key.keyboard.keypad.1 1​[until: JE 26.3]
Keypad 1​[upcoming: JE 26.3]
Numpad 1 key.keyboard.keypad.1[note 11]
key.keyboard.keypad.2 2​[until: JE 26.3]
Keypad 2​[upcoming: JE 26.3]
Numpad 2 key.keyboard.keypad.2[note 11]
key.keyboard.keypad.3 3​[until: JE 26.3]
Keypad 3​[upcoming: JE 26.3]
Numpad 3 key.keyboard.keypad.3[note 11]
key.keyboard.keypad.4 4​[until: JE 26.3]
Keypad 4​[upcoming: JE 26.3]
Numpad 4 key.keyboard.keypad.4[note 11]
key.keyboard.keypad.5 5​[until: JE 26.3]
Keypad 5​[upcoming: JE 26.3]
Numpad 5 key.keyboard.keypad.5[note 11]
key.keyboard.keypad.6 6​[until: JE 26.3]
Keypad 6​[upcoming: JE 26.3]
Numpad 6 key.keyboard.keypad.6[note 11]
key.keyboard.keypad.7 7​[until: JE 26.3]
Keypad 7​[upcoming: JE 26.3]
Numpad 7 key.keyboard.keypad.7[note 11]
key.keyboard.keypad.8 8​[until: JE 26.3]
Keypad 8​[upcoming: JE 26.3]
Numpad 8 key.keyboard.keypad.8[note 11]
key.keyboard.keypad.9 9​[until: JE 26.3]
Keypad 9​[upcoming: JE 26.3]
Numpad 9 key.keyboard.keypad.9[note 11]
key.keyboard.keypad.add +​[until: JE 26.3]
Keypad +​[upcoming: JE 26.3]
Numpad + key.keyboard.keypad.add[note 11]
key.keyboard.keypad.subtract -​[until: JE 26.3]
Keypad -​[upcoming: JE 26.3]
Numpad - key.keyboard.keypad.subtract[note 11]
key.keyboard.keypad.multiply *​[until: JE 26.3]
Keypad *​[upcoming: JE 26.3]
Numpad * key.keyboard.keypad.multiply[note 11]
key.keyboard.keypad.divide /​[until: JE 26.3]
Keypad /​[upcoming: JE 26.3]
Numpad / key.keyboard.keypad.divide[note 11]
key.keyboard.keypad.equal =​[until: JE 26.3]
Keypad =​[upcoming: JE 26.3]
Numpad = key.keyboard.keypad.equal[note 11]
key.keyboard.keypad.plus.minus​[upcoming: JE 26.3] Keypad ± Numpad ± key.keyboard.keypad.plus.minus
key.keyboard.keypad.left.parenthesis​[upcoming: JE 26.3] Keypad ( Numpad ( key.keyboard.keypad.left.parenthesis
key.keyboard.keypad.right.parenthesis​[upcoming: JE 26.3] Keypad ) Numpad ) key.keyboard.keypad.right.parenthesis
key.keyboard.keypad.decimal .​[until: JE 26.3]
Keypad Decimal​[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] Keypad . Numpad .[3] key.keyboard.keypad.period
key.keyboard.keypad.comma​[upcoming: JE 26.3] Keypad , Numpad ,[note 12] key.keyboard.keypad.comma
key.keyboard.keypad.enter Keypad Enter ⎆ Numpad Enter key.keyboard.keypad.enter
key.keyboard.menu Menu ≣ Menu​[until: JE 26.3] key.keyboard.menu
key.keyboard.application​[upcoming: JE 26.3] Application ≣ Menu key.keyboard.application
key.keyboard.num.lock Num Lock Num Lock key.keyboard.num.lock
key.keyboard.caps.lock Caps Lock ⇪ Caps Lock key.keyboard.caps.lock
key.keyboard.scroll.lock Scroll Lock ⤓ Scroll Lock key.keyboard.scroll.lock
key.keyboard.delete Delete ⌦ Delete key.keyboard.delete
key.keyboard.insert Insert ⎀ Insert key.keyboard.insert
key.keyboard.home Home ⇱ Home key.keyboard.home
key.keyboard.end End ⇲ End key.keyboard.end
key.keyboard.print.screen Print Screen ⎙ Print Screen / System Request key.keyboard.print.screen
key.keyboard.pause Pause Pause / ⎊ Break key.keyboard.pause
key.keyboard.page.up Page Up ⇞ Page Up key.keyboard.page.up
key.keyboard.page.down Page Down ⇟ Page Down key.keyboard.page.down
key.keyboard.up Up Arrow ↑ Up key.keyboard.up
key.keyboard.left Left Arrow ← Left key.keyboard.left
key.keyboard.right Right Arrow → Right key.keyboard.right
key.keyboard.down Down Arrow ↓ Down key.keyboard.down
key.keyboard.escape Escape Cannot be assigned[note 13] key.keyboard.escape
key.keyboard.enter Enter ⏎ Return key.keyboard.enter
key.keyboard.backspace Backspace ⌫ Backspace key.keyboard.backspace
key.keyboard.left.shift Left Shift ⇧ Left Shift key.keyboard.left.shift
key.keyboard.right.shift Right Shift ⇧ Right Shift key.keyboard.right.shift
key.keyboard.left.control Left Control ⎈ Left Control key.keyboard.left.control
key.keyboard.right.control Right Control ⎈ Right Control key.keyboard.right.control
key.keyboard.left.alt Left Alt Windows
Linux
⌥ Left Alt key.keyboard.left.alt
Left Option​[upcoming: JE 26.3] macOS ⌥ Left Option key.keyboard.left.option​[upcoming: JE 26.3]
key.keyboard.right.alt Right Alt[4] Windows
Linux
⌥ Right Alt key.keyboard.right.alt
Right Option​[upcoming: JE 26.3] macOS ⌥ Right Option key.keyboard.right.option​[upcoming: JE 26.3]
key.keyboard.left.win Left Win​[until: JE 26.3]
Left Windows​[upcoming: JE 26.3]
Windows ⊞ Left Windows key.keyboard.left.win​[until: JE 26.3]
key.keyboard.left.windows​[upcoming: JE 26.3]
Left Command​[upcoming: JE 26.3] macOS ⌘ Left Command key.keyboard.left.command​[upcoming: JE 26.3]
Left Meta​[upcoming: JE 26.3] Linux ◆ Left Meta key.keyboard.left.meta​[upcoming: JE 26.3]
key.keyboard.right.win Right Win​[until: JE 26.3]
Right Windows​[upcoming: JE 26.3]
Windows ⊞ Right Windows key.keyboard.right.win​[until: JE 26.3]
key.keyboard.right.windows​[upcoming: JE 26.3]
Right Command​[upcoming: JE 26.3] macOS ⌘ Right Command key.keyboard.right.command​[upcoming: JE 26.3]
Right Meta​[upcoming: JE 26.3] Linux ◆ Right Meta key.keyboard.right.meta​[upcoming: JE 26.3]
key.keyboard.mute​[upcoming: JE 26.3] Mute 🔇︎ Mute key.keyboard.mute
key.keyboard.volume.down​[upcoming: JE 26.3] Volume Down 🔉︎ Volume Down key.keyboard.volume.down
key.keyboard.volume.up​[upcoming: JE 26.3] Volume Up 🔊︎ Volume Up key.keyboard.volume.up
key.keyboard.media.play.pause​[upcoming: JE 26.3] Play/Pause ⏯︎ Play/Pause key.keyboard.media.play.pause
key.keyboard.stop​[upcoming: JE 26.3] Stop Stop key.keyboard.stop
key.keyboard.cut​[upcoming: JE 26.3] Cut Cut key.keyboard.cut
key.keyboard.copy​[upcoming: JE 26.3] Copy Copy key.keyboard.copy
key.keyboard.paste​[upcoming: JE 26.3] Paste Paste key.keyboard.paste
key.keyboard.undo​[upcoming: JE 26.3] Undo ⎌ Undo key.keyboard.undo
key.keyboard.again​[upcoming: JE 26.3] Again Redo[5] key.keyboard.again
key.keyboard.ac.new​[upcoming: JE 26.3] AC New 📄 New key.keyboard.ac.new
key.keyboard.ac.save​[upcoming: JE 26.3] AC Save 💾 Save key.keyboard.ac.save
key.keyboard.help​[upcoming: JE 26.3] Help Help key.keyboard.help
key.keyboard.find​[upcoming: JE 26.3] Find Find key.keyboard.find
scancode.[note 14]​[until: JE 26.3] scancode.[note 14] Keys with no assigned ID scancode.[note 14]
key.keyboard.[note 15]​[upcoming: JE 26.3] key.keyboard.[note 15] Keys with no assigned ID key.keyboard.[note 15]
Without names
This section describes a planned feature.[citation needed]
 
It has not appeared in any development versions yet, but is planned to be included in a future update.

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
key.keyboard.102 ⏻ Power MC-310991
key.keyboard.135 ろ (JIS) / / (ABNT) MC-310944
key.keyboard.136 Katakana/Hiragana MC-310944
key.keyboard.137 ¥ MC-310944
key.keyboard.138 変換 Henkan MC-310944
key.keyboard.139 無変換 Muhenkan MC-310944
key.keyboard.144 한⁄영 Han/Yeong MC-310944
key.keyboard.145 한자 Hanja MC-310944
key.keyboard.146 Katakana MC-310944
key.keyboard.147 Hiragana MC-310944
key.keyboard.155 Cancel MC-311035
key.keyboard.257 全角⁄半角 Halfwidth/Fullwidth MC-310984
key.keyboard.258 ⏾ Sleep MC-310991
key.keyboard.259 Wake MC-310991
key.keyboard.262 ▶︎ Play MC-310116
key.keyboard.263 ⏸︎ Pause MC-310116
key.keyboard.264 ⏺︎ Record MC-310116
key.keyboard.265 ⏩︎ Fast Forward MC-310116
key.keyboard.266 ⏪︎ Rewind MC-310116
key.keyboard.267 ⏭︎ Next Track MC-310116
key.keyboard.268 ⏮︎ Previous Track MC-310116
key.keyboard.269 ⏹︎ Stop MC-310116
key.keyboard.270 ⏏︎ Eject MC-310116
key.keyboard.272 Media Select MC-310116
key.keyboard.274 📂 Open MC-311010
key.keyboard.275 Application Close MC-311010
key.keyboard.276 Application Exit MC-311010
key.keyboard.279 Application Properties MC-311010
key.keyboard.280 🔍︎ Search MC-311010
key.keyboard.281 ⌂ Home MC-311010
key.keyboard.282 ⬅︎ Back MC-311010
key.keyboard.283 ➡︎ Forward MC-311010
key.keyboard.285 🔄︎ Refresh MC-311010
key.keyboard.286 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] Left Button  Left Mouse Button Yes Yes Yes
key.mouse.right[note 18] Right Button  Right Mouse Button Yes Yes Yes
key.mouse.middle[note 19] Middle Button  Middle Mouse Button Yes Yes Yes
key.mouse.4 Button 4  Fourth Mouse Button Yes Yes Yes
key.mouse.5 Button 5  Fifth Mouse Button Yes Yes Yes
key.mouse.6 Button 6  Sixth Mouse Button No Yes Yes
key.mouse.7 Button 7  Seventh Mouse Button No Yes Yes
key.mouse.8 Button 8  Eighth Mouse Button No Yes Yes
key.mouse.9 Button 9  Ninth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.10 Button 10  Tenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.11 Button 11  Eleventh Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.12 Button 12  Twelfth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.13 Button 13  Thirteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.14 Button 14  Fourteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.15 Button 15  Fifteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.16 Button 16  Sixteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.17 Button 17  Seventeenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.18 Button 18  Eighteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.19 Button 19  Nineteenth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.20 Button 20  Twentieth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.21 Button 21  Twenty-First Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.22 Button 22  Twenty-Second Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.23 Button 23  Twenty-Third Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.24 Button 24  Twenty-Fourth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.25 Button 25  Twenty-Fifth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.26 Button 26  Twenty-Sixth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.27 Button 27  Twenty-Seventh Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.28 Button 28  Twenty-Eighth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.29 Button 29  Twenty-Ninth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.30 Button 30  Thirtieth Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.31 Button 31  Thirty-First Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.32 Button 32  Thirty-Second Mouse Button No Yes​[upcoming: JE 26.3] Yes​[upcoming: JE 26.3]
key.mouse.33 Button 33  Thirty-Third Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.34 Button 34  Thirty-Fourth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.35 Button 35  Thirty-Fifth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.36 Button 36  Thirty-Sixth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.37 Button 37  Thirty-Seventh Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.38 Button 38  Thirty-Eighth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.39 Button 39  Thirty-Ninth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.40 Button 40  Fortieth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.41 Button 41  Forty-First Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.42 Button 42  Forty-Second Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.43 Button 43  Forty-Third Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.44 Button 44  Forty-Fourth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.45 Button 45  Forty-Fifth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.46 Button 46  Forty-Sixth Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.47 Button 47  Forty-Seventh Mouse Button No No Yes​[upcoming: JE 26.3]
key.mouse.48 Button 48  Forty-Eighth Mouse Button No No Yes​[upcoming: JE 26.3]

Bedrock Edition

Keyboard codes

This section is missing information about: In the lang files there are translation strings for each translatable keycode that is a shortened version (e.g. PgUp instead of PAGE UP). Figure out if these ever appear in the game and, if they do, add a column for them.
 
Please expand the section to include this information. Further details may exist on the talk page.
This section needs cleanup to comply with the style guide.
 [discuss]
Please help improve this section. The talk page may contain suggestions.
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 Unassigned Not Bound ​[more information needed]
3 Button3[note 20] Pause / ⎊ Break
8 BACK ⌫ Backspace keyboard.keyName.backspace
9 TAB ↹ Tab keyboard.keyName.tab
12 Button12 Clear
13 RETURN ⏎ Return keyboard.keyName.return
16 SHIFT ⇧ Left Shift / ⇧ Right Shift keyboard.keyName.lshift
17 CONTROL ⎈ Left Control / ⎈ Right Control keyboard.keyName.control
18 ALTERNATIVE ⌥ Left Alt / ⌥ Right Alt keyboard.keyName.alt
19 PAUSE Pause / ⎊ Break keyboard.keyName.pause
20 CAPITAL ⇪ Caps Lock keyboard.keyName.capsLock
21 Button21 IME Kana​[more information needed] / 한⁄영 Han/Yeong
22 Button22 IME on
23 Button23 IME Junja
24 Button24 IME final mode
25 Button25 한자 Hanja / IME Kanji
26 Button26 IME off
27 ESCAPE Cannot be assigned[note 21] keyboard.keyName.escape
28 Button28 変換 Henkan
29 Button29 無変換 Muhenkan
30 Button30 IME accept
31 Button31 IME mode change request
32 SPACE ␣ Space keyboard.keyName.space
33 PAGE UP ⇞ Page Up keyboard.keyName.pgUp
34 PAGE DOWN ⇟ Page Down keyboard.keyName.pgDown
35 END ⇲ End keyboard.keyName.end
36 HOME ⇱ Home keyboard.keyName.home
37 LEFT ← Left keyboard.keyName.left
38 UP ↑ Up keyboard.keyName.up
39 RIGHT → Right keyboard.keyName.right
40 DOWN ↓ Down keyboard.keyName.down
41 Button41 Select
42 Button42 Print
43 Button43 Execute
44 Button44 ⎙ Print Screen / System Request
45 INSERT ⎀ Insert keyboard.keyName.insert
46 DELETE ⌦ Delete keyboard.keyName.delete
47 Button47 Help
48 0 0 keyboard.keyName.0
49 1 1 keyboard.keyName.1
50 2 2 keyboard.keyName.2
51 3 3 keyboard.keyName.3
52 4 4 keyboard.keyName.4
53 5 5 keyboard.keyName.5
54 6 6 keyboard.keyName.6
55 7 7 keyboard.keyName.7
56 8 8 keyboard.keyName.8
57 9 9 keyboard.keyName.9
65 A A keyboard.keyName.a
66 B B keyboard.keyName.b
67 C C keyboard.keyName.c
68 D D keyboard.keyName.d
69 E E keyboard.keyName.e
70 F F keyboard.keyName.f
71 G G keyboard.keyName.g
72 H H keyboard.keyName.h
73 I I keyboard.keyName.i
74 J J keyboard.keyName.j
75 K K keyboard.keyName.k
76 L L keyboard.keyName.l
77 M M keyboard.keyName.m
78 N N keyboard.keyName.n
79 O O keyboard.keyName.o
80 P P keyboard.keyName.p
81 Q Q keyboard.keyName.q
82 R R keyboard.keyName.r
83 S S keyboard.keyName.s
84 T T keyboard.keyName.t
85 U U keyboard.keyName.u
86 V V keyboard.keyName.v
87 W W keyboard.keyName.w
88 X X keyboard.keyName.x
89 Y Y keyboard.keyName.y
90 Z Z keyboard.keyName.z
91 Button91 ⊞ Left Windows / ⌘ Left Command / Chromebook Search
92 Button92 ⊞ Right Windows / ⌘ Right Command
93 Button93 ≣ Menu
95 Button95 ⏾ Sleep
96 NUMPAD0 Numpad 0 keyboard.keyName.numpad0
97 NUMPAD1 Numpad 1 keyboard.keyName.numpad1
98 NUMPAD2 Numpad 2 keyboard.keyName.numpad2
99 NUMPAD3 Numpad 3 keyboard.keyName.numpad3
100 NUMPAD4 Numpad 4 keyboard.keyName.numpad4
101 NUMPAD5 Numpad 5 keyboard.keyName.numpad5
102 NUMPAD6 Numpad 6 keyboard.keyName.numpad6
103 NUMPAD7 Numpad 7 keyboard.keyName.numpad7
104 NUMPAD8 Numpad 8 keyboard.keyName.numpad8
105 NUMPAD9 Numpad 9 keyboard.keyName.numpad9
106 MULTIPLY Numpad * keyboard.keyName.multiply
107 ADD Numpad + keyboard.keyName.add
108 Button108 Separator
109 SUBTRACT Numpad - keyboard.keyName.subtract
110 DECIMAL Numpad . keyboard.keyName.decimal
111 DIVIDE Numpad / keyboard.keyName.divide
112 F1 F1 keyboard.keyName.f1
113 F2 F2 keyboard.keyName.f2
114 F3 F3 keyboard.keyName.f3
115 F4 F4 keyboard.keyName.f4
116 F5 F5 keyboard.keyName.f5
117 F6 F6 keyboard.keyName.f6
118 F7 F7 keyboard.keyName.f7
119 F8 F8 keyboard.keyName.f8
120 F9 F9 keyboard.keyName.f9
121 F10 F10 keyboard.keyName.f10
122 F11 F11 keyboard.keyName.f11
123 F12 F12 keyboard.keyName.f12
124 F13 F13 keyboard.keyName.f13
125 Button125 F14
126 Button126 F15
127 Button127 F16
128 Button128 F17
129 Button129 F18
130 Button130 F19
131 Button131 F20
132 Button132 F21
133 Button133 F22
134 Button134 F23
135 Button135 F24
144 NUMLOCK Num Lock keyboard.keyName.numLock
145 SCROLL ⤓ Scroll Lock keyboard.keyName.scroll
146 Button146 OEM-Specific[note 22]
147 Button147 OEM-Specific[note 22]
148 Button148 OEM-Specific[note 22]
149 Button149 OEM-Specific[note 22]
150 Button150 OEM-Specific[note 22]
166 Button166 Browser Back
167 Button167 Browser Forward
168 Button168 Browser Refresh
169 Button169 Browser Stop
170 Button170 Browser Search
171 Button171 Browser Favorites
172 Button172 Browser Start and Home
173 Button173 🔇︎ Mute
174 Button174 🔉︎ Volume Down
175 Button175 🔊︎ Volume Up
176 Button176 ⏭︎ Next Track
177 Button177 ⏮︎ Previous Track
178 Button178 ⏹︎ Stop
179 Button179 ⏯︎ Play/Pause
180 Button180 Start Mail
181 Button181 Media Select
182 Button182 Start Application 1
183 Button183 Start Application 2
186 SEMICOLON ; keyboard.keyName.semicolon
187 EQUALS = keyboard.keyName.equals
188 COMMA , keyboard.keyName.comma
189 MINUS - keyboard.keyName.minus
190 PERIOD . keyboard.keyName.period
191 SLASH / keyboard.keyName.slash
192 GRAVE ` keyboard.keyName.grave
219 LBRACKET [ keyboard.keyName.lbracket
220 BACKSLASH \​[more information needed] keyboard.keyName.backslash
221 RBRACKET ] keyboard.keyName.rbracket
222 APOSTROPHE ' keyboard.keyName.apostrophe
223 Button223 OEM-Specific[note 22]
225 Button225 OEM-Specific[note 22]
226 Button226 OEM-Specific[note 22]
227 Button227 OEM-Specific[note 22]
228 Button228 OEM-Specific[note 22]
229 Button229 IME process
230 Button230 OEM-Specific[note 22]
231 Button231 ​[more information needed]
233 Button233 OEM-Specific[note 22]
234 Button234 OEM-Specific[note 22]
235 Button235 OEM-Specific[note 22]
236 Button236 OEM-Specific[note 22]
237 Button237 OEM-Specific[note 22]
238 Button238 OEM-Specific[note 22]
239 Button239 OEM-Specific[note 22]
240 Button240 OEM-Specific[note 22]
241 Button241 OEM-Specific[note 22]
242 Button242 OEM-Specific[note 22]
243 Button243 OEM-Specific[note 22]
244 Button244 OEM-Specific[note 22]
245 Button245 OEM-Specific[note 22]
246 Button246 Attn
247 Button247 CrSel
248 Button248 ExSel
249 Button249 Erase EOF
250 Button250 Play
251 Button251 Zoom
253 Button253 PA1
254 Button254 Clear

Mouse codes

This section is missing information about: how many mouse buttons does bedrock support? there are no official Linux versions, but perhaps chrome OS, or iOS with an attached mouse, could support more than Windows's five
 
Please expand the section to include this information. Further details may exist on the talk page.

Mouse buttons are represented by negative numbers.

ID Displayed name Description
-99 Button1  Left Mouse Button
-98 Button2  Right Mouse Button
-97 Button3  Middle Mouse Button
-95 Button5  Fourth Mouse Button
-94 Button6  Fifth Mouse Button

Controller codes

This section is missing information about: verify key code ids for nintendo switch and play station
 
Please expand the section to include this information. Further details may exist on the talk page.
ID Display Description
WindowsChromeOSAndroidiOSiPadOSAmazon FireXboxXbox One Nintendo Switch 2 │ Nintendo Switch PlayStation
PlayStation 4 PlayStation 5
0 Not Bound
1 A button A button Cross button Cross button A
2 B button B button Circle button Circle button B
3 X button Y button Square button Square button X
4 Y button X button Triangle button Triangle button Y
5 D-pad up button Up button/D-pad up button D-pad up button D-Pad Up
6 D-pad down button Down button/D-pad down button D-pad down button D-Pad Down
7 D-pad left button Left button/D-pad left button D-pad left button D-Pad Left
8 D-pad right button Right button/D-pad right button D-pad right button D-Pad Right
9 Left stick click button Left stick press button L3 button Left Stick Click
10 Right stick click button Right stick press button R3 button Right Stick Click
11 Left Bumper L button L1 button Left Bumper
12 Right Button R button R1 button Right Bumper
13 View button - button Touch pad button Touch pad button Select
14 Menu button + button Options button Options button Menu
16 Left stick down Left stick down Left stick down Left Stick Down
17 Left stick left Left stick right Left stick left Left Stick Right
18 Left stick left Left stick left Left stick left Left Stick Left
19 Left stick up Left stick up Left stick up Left Stick Up
-100 Left Trigger ZL button L2 button Left Trigger
-99 Right Trigger ZR button R2 button Right Trigger

History

Java Edition

Java Edition Classic
0.0.23aControls can now be customized. Only keyboard buttons are recognised as valid for rebinding.
Java Edition Beta
1.8Pre-releaseControls can now be bound to mouse buttons; these are handled using negative numbers.
Java Edition
1.1217w16aThe first three mouse buttons are now displayed as "Left Click", "Right Click" and "Middle Click".
1.1317w43aWith 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.
17w45aKeyboard 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.
17w49akey.keyboard.unknown is now used for controls that are not bound to anything.
pre4Keypad 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.1922w16aControls that are not bound to anything now display "Not bound".
1.20pre2Letter keys are now displayed in uppercase again.
pre3Controls that are not bound to anything now display "Not Bound".
Upcoming Java Edition
26.3snap4Valid 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.
snap7Several 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]
snap9Translatable 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
This section of the article is empty.
 
You can help by expanding it.
transfer F25 here when 26.3 comes out

Notes

  1. ↑ 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]
  2. ↑ Also used by keys unrecognised by SDL3, see MC-310108​[upcoming: JE 26.3]
  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.
  4. ↑ 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]
  5. ↑ device dependent; this appears on Windows, but it appears as \ on Linux
  6. ↑ 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.
  7. ↑ a b This translation key could be used with certain keyboard layouts or operating systems.
  8. ↑ 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.
  9. ↑ The "Settings" key also maps to this on Linux, for some reason: MC-310119
  10. ↑ 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.
  11. ↑ 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]
  12. ↑ Appears to instead be interpreted as the keypad decimal point key on Linux: MC-310845
  13. ↑ Trying to bind anything to the Escape key causes it to become Not Bound instead. This can only be set by modifying options.txt.
  14. ↑ a b c Two or three digit number representing operating system key ID
  15. ↑ a b c Three digit number representing SDL3 key ID
  16. ↑ 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.
  17. ↑ key.mouse.1 is automatically converted to this​[more information needed]
  18. ↑ key.mouse.3 is automatically converted to this
  19. ↑ key.mouse.2 is automatically converted to this
  20. ↑ Displayed the same as the middle mouse button.
  21. ↑ Trying to bind anything to the Escape key causes it to become Unassigned instead. This can only be set by modifying options.txt.
  22. ↑ 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

Sources