Mineuniverse

Key codes

This is a list of key codes used by Minecraft, which are used in the options.txt file.

33 min read Updated 2 views
Gameplay
Advertisement Remove ads with Premium →
Contents (11)
  1. Java Edition
  2. Keyboard codes
  3. Mouse codes
  4. Bedrock Edition
  5. Keyboard codes
  6. Mouse codes
  7. Controller codes
  8. History
  9. Java Edition
  10. Notes
  11. References
For other uses, see Key.

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 recognizable 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

Keyboard buttons are handled as a signed 32-bit integer, meaning that through editing options.txt, values from key.keyboard.-2147483648 to key.keyboard.2147483647 can be specified without being rejected by the game as invalid. Any keys corresponding to a valid SDL key code will be automatically converted to one of the named keys below.

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, or unrecognized[2] key.keyboard.unknown
key.keyboard.0 0 0 [note 2]
key.keyboard.1 1 1 [note 2]
key.keyboard.2 2 2 [note 2]
key.keyboard.3 3 3 [note 2]
key.keyboard.4 4 4 [note 2]
key.keyboard.5 5 5 [note 2]
key.keyboard.6 6 6 [note 2]
key.keyboard.7 7 7 [note 2]
key.keyboard.8 8 8 [note 2]
key.keyboard.9 9 9 [note 2]
key.keyboard.a A A [note 2]
key.keyboard.b B B [note 2]
key.keyboard.c C C [note 2]
key.keyboard.d D D [note 2]
key.keyboard.e E E [note 2]
key.keyboard.f F F [note 2]
key.keyboard.g G G [note 2]
key.keyboard.h H H [note 2]
key.keyboard.i I I [note 2]
key.keyboard.j J J [note 2]
key.keyboard.k K K [note 2]
key.keyboard.l L L [note 2]
key.keyboard.m M M [note 2]
key.keyboard.n N N [note 2]
key.keyboard.o O O [note 2]
key.keyboard.p P P [note 2]
key.keyboard.q Q Q [note 2]
key.keyboard.r R R [note 2]
key.keyboard.s S S [note 2]
key.keyboard.t T T [note 2]
key.keyboard.u U U [note 2]
key.keyboard.v V V [note 2]
key.keyboard.w W W [note 2]
key.keyboard.x X X [note 2]
key.keyboard.y Y Y [note 2]
key.keyboard.z Z Z [note 2]
key.keyboard.space Space ␣ Space key.keyboard.space
key.keyboard.tab Tab ↹ Tab key.keyboard.tab
key.keyboard.apostrophe ' ' key.keyboard.apostrophe[note 3]
key.keyboard.backslash \ \ (ANSI) key.keyboard.backslash[note 3]
key.keyboard.comma , , key.keyboard.comma[note 3]
key.keyboard.equal = = key.keyboard.equal[note 3]
key.keyboard.grave.accent ` ` key.keyboard.grave.accent[note 3]
key.keyboard.left.bracket [ [ key.keyboard.left.bracket[note 3]
key.keyboard.minus - - key.keyboard.minus[note 3]
key.keyboard.period . . key.keyboard.period[note 3]
key.keyboard.right.bracket ] ] key.keyboard.right.bracket[note 3]
key.keyboard.semicolon ; ; key.keyboard.semicolon[note 3]
key.keyboard.slash / / key.keyboard.slash[note 3]
key.keyboard.world.1 \ \ (ISO) key.keyboard.world.1[note 4]
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 5] 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.keypad.0 Keypad 0 Numpad 0 key.keyboard.keypad.0
key.keyboard.keypad.1 Keypad 1 Numpad 1 key.keyboard.keypad.1
key.keyboard.keypad.2 Keypad 2 Numpad 2 key.keyboard.keypad.2
key.keyboard.keypad.3 Keypad 3 Numpad 3 key.keyboard.keypad.3
key.keyboard.keypad.4 Keypad 4 Numpad 4 key.keyboard.keypad.4
key.keyboard.keypad.5 Keypad 5 Numpad 5 key.keyboard.keypad.5
key.keyboard.keypad.6 Keypad 6 Numpad 6 key.keyboard.keypad.6
key.keyboard.keypad.7 Keypad 7 Numpad 7 key.keyboard.keypad.7
key.keyboard.keypad.8 Keypad 8 Numpad 8 key.keyboard.keypad.8
key.keyboard.keypad.9 Keypad 9 Numpad 9 key.keyboard.keypad.9
key.keyboard.keypad.add Keypad + Numpad + key.keyboard.keypad.add
key.keyboard.keypad.subtract Keypad - Numpad - key.keyboard.keypad.subtract
key.keyboard.keypad.multiply Keypad * Numpad * key.keyboard.keypad.multiply
key.keyboard.keypad.divide Keypad / Numpad / key.keyboard.keypad.divide
key.keyboard.keypad.equal Keypad = Numpad = key.keyboard.keypad.equal
key.keyboard.keypad.plus.minus Keypad ± Numpad ± key.keyboard.keypad.plus.minus
key.keyboard.keypad.left.parenthesis Keypad ( Numpad ( key.keyboard.keypad.left.parenthesis
key.keyboard.keypad.right.parenthesis Keypad ) Numpad ) key.keyboard.keypad.right.parenthesis
key.keyboard.keypad.period Keypad . Numpad . key.keyboard.keypad.period
key.keyboard.keypad.comma Keypad , Numpad ,[note 6] key.keyboard.keypad.comma
key.keyboard.keypad.enter Keypad Enter ⎆ Numpad Enter key.keyboard.keypad.enter
key.keyboard.menu Menu ⎄ Compose key.keyboard.menu
key.keyboard.application 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 key.keyboard.print.screen
key.keyboard.sys.req SysRq[note 7] System Request[note 8] key.keyboard.sys.req
key.keyboard.pause Pause ⎉ Pause 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 9] 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 macOS ⌥ Left Option key.keyboard.left.option
key.keyboard.right.alt Right Alt[3] Windows
Linux
⌥ Right Alt key.keyboard.right.alt
Right Option macOS ⌥ Right Option key.keyboard.right.option
key.keyboard.left.win Left Windows Windows ⊞ Left Windows key.keyboard.left.windows
Left Command macOS ⌘ Left Command key.keyboard.left.command
Left Meta Linux ◆ Left Meta key.keyboard.left.meta
key.keyboard.right.win Right Windows Windows ⊞ Right Windows key.keyboard.right.windows
Right Command macOS ⌘ Right Command key.keyboard.right.command
Right Meta Linux ◆ Right Meta key.keyboard.right.meta
key.keyboard.lang1[4] Language 1[4] Windows/Linux 한⁄영 Han/Yeong key.keyboard.lang1[4]
macOS かな Kana
key.keyboard.lang2[4] Language 2[4] Windows/Linux 한자 Hanja key.keyboard.lang2[4]
macOS 英数 Eisu
key.keyboard.lang3[4] Language 3[4] Katakana key.keyboard.lang3[4]
key.keyboard.lang4[4] Language 4[4] Hiragana key.keyboard.lang4[4]
key.keyboard.lang5[4] Language 5[4] 全角⁄半角 Zenkaku/Hankaku[note 6] key.keyboard.lang5[4]
key.keyboard.international1[4] International 1[4] ろ (JIS) / / (ABNT) key.keyboard.international1[4]
key.keyboard.international2[4] International 2[4] Katakana/Hiragana key.keyboard.international2[4]
key.keyboard.international3[4] International 3[4] ¥ key.keyboard.international3[4]
key.keyboard.international4[4] International 4[4] 変換 Henkan key.keyboard.international4[4]
key.keyboard.international5[4] International 5[4] 無変換 Muhenkan key.keyboard.international5[4]
key.keyboard.international6[5] International 6[5] Numpad , (PC-9800)[note 10] key.keyboard.international6[5]
key.keyboard.mute Mute 🔇︎ Mute key.keyboard.mute
key.keyboard.volume.down Volume Down 🔉︎ Volume Down key.keyboard.volume.down
key.keyboard.volume.up Volume Up 🔊︎ Volume Up key.keyboard.volume.up
key.keyboard.media.play.pause Play/Pause ⏯︎ Play/Pause key.keyboard.media.play.pause
key.keyboard.media.play Media Play ▶︎ Play key.keyboard.media.play
key.keyboard.media.pause Media Pause ⏸︎ Pause key.keyboard.media.pause
key.keyboard.media.record Record ⏺︎ Record key.keyboard.media.record
key.keyboard.media.fast.forward Fast Forward ⏩︎ Fast Forward key.keyboard.media.fast.forward
key.keyboard.media.rewind Rewind ⏪︎ Rewind key.keyboard.media.rewind
key.keyboard.media.next.track Next Track ⏭︎ Next Track key.keyboard.media.next.track
key.keyboard.media.previous.track Previous Track ⏮︎ Previous Track key.keyboard.media.previous.track
key.keyboard.media.stop Media Stop ⏹︎ Stop key.keyboard.media.stop
key.keyboard.media.eject Eject ⏏︎ Eject key.keyboard.media.eject
key.keyboard.media.select Media Select Media Select key.keyboard.media.select
key.keyboard.stop Stop Stop[note 6] key.keyboard.stop
key.keyboard.cancel Cancel Cancel key.keyboard.cancel
key.keyboard.cut Cut Cut key.keyboard.cut
key.keyboard.copy Copy Copy key.keyboard.copy
key.keyboard.paste Paste Paste key.keyboard.paste
key.keyboard.undo Undo ⎌ Undo key.keyboard.undo
key.keyboard.again Again Redo[6] key.keyboard.again
key.keyboard.ac.new AC New 📄 New key.keyboard.ac.new
key.keyboard.ac.open AC Open 📂 Open key.keyboard.ac.open
key.keyboard.ac.save AC Save 💾 Save key.keyboard.ac.save
key.keyboard.help Help Help key.keyboard.help
key.keyboard.find Find Find key.keyboard.find
key.keyboard.ac.close AC Close Application Close key.keyboard.ac.close
key.keyboard.ac.exit AC Exit Application Exit[note 6] key.keyboard.ac.exit
key.keyboard.ac.stop AC Stop Application Stop key.keyboard.ac.stop
key.keyboard.ac.properties AC Properties Application Properties[note 6] key.keyboard.ac.properties
key.keyboard.ac.search AC Search 🔍︎ Search key.keyboard.ac.search
key.keyboard.ac.home AC Home ⌂ Home key.keyboard.ac.home
key.keyboard.ac.back AC Back ⬅︎ Back key.keyboard.ac.back
key.keyboard.ac.forward AC Forward ➡︎ Forward key.keyboard.ac.forward
key.keyboard.ac.refresh AC Refresh 🔄︎ Refresh key.keyboard.ac.refresh
key.keyboard.ac.bookmarks AC Favorites Application Bookmarks key.keyboard.ac.bookmarks
key.keyboard.power Power ⏻ Power key.keyboard.power
key.keyboard.sleep Sleep ⏾ Sleep key.keyboard.sleep
key.keyboard.wake Wake Wake[note 6] key.keyboard.wake
key.keyboard.alternate.erase Alternate Erase [note 6] key.keyboard.alternate.erase
key.keyboard.channel.down Channel Down [note 11] key.keyboard.channel.down
key.keyboard.channel.up Channel Up [note 11] key.keyboard.channel.up
key.keyboard.clear Clear [note 12] key.keyboard.clear
key.keyboard.mode Mode [note 12][note 13] key.keyboard.mode
key.keyboard.select Select [note 12] key.keyboard.select
key.keyboard.[note 14] key.keyboard.[note 14] Undefined key IDs key.keyboard.[note 14]

Unused

Minecraft includes IDs and translation strings for all named SDL3 key IDs, even those which are not present in the key binding files for any supported operating system, and therefore cannot be accessed.

These can be set via modifying options.txt manually, but will not be triggerable due to the lack of an associated key.

Keys such as Escape may warrant inclusion here. It may also be worth creating a table for accidentally-unassignable keys.

ID[note 15] Displayed name Notes
key.keyboard.ac.print AC Print
key.keyboard.call Call This is a mobile phone button.[7]
key.keyboard.clear.again Clear Again
key.keyboard.crsel CrSel
key.keyboard.currency.subunit Currency Subunit
key.keyboard.currency.unit Currency Unit
key.keyboard.decimal.separator Decimal Separator
key.keyboard.end.call End Call This is a mobile phone button.[7]
key.keyboard.enter2 Enter 2
key.keyboard.execute Execute
key.keyboard.exsel ExSel
key.keyboard.international7 International 7
key.keyboard.international8 International 8
key.keyboard.international9 International 9
key.keyboard.keypad.00 Keypad 00
key.keyboard.keypad.000 Keypad 000
key.keyboard.keypad.a Keypad A
key.keyboard.keypad.ampersand Keypad &
key.keyboard.keypad.at Keypad @
key.keyboard.keypad.b Keypad B
key.keyboard.keypad.backspace Keypad Backspace
key.keyboard.keypad.binary Keypad Binary
key.keyboard.keypad.c Keypad C
key.keyboard.keypad.clear Keypad Clear
key.keyboard.keypad.clear.entry Keypad Clear Entry
key.keyboard.keypad.colon Keypad :
key.keyboard.keypad.d Keypad D
key.keyboard.keypad.decimal Keypad Decimal
key.keyboard.keypad.double.ampersand Keypad &&
key.keyboard.keypad.double.vertical.bar Keypad ||
key.keyboard.keypad.e Keypad E
key.keyboard.keypad.equals.as400 Keypad = (AS400)
key.keyboard.keypad.exclamation Keypad !
key.keyboard.keypad.f Keypad F
key.keyboard.keypad.greater Keypad >
key.keyboard.keypad.hash Keypad #
key.keyboard.keypad.hexadecimal Keypad Hexadecimal
key.keyboard.keypad.left.brace Keypad {
key.keyboard.keypad.less Keypad <
key.keyboard.keypad.memory.add Keypad M+
key.keyboard.keypad.memory.clear Keypad MC
key.keyboard.keypad.memory.divide Keypad M/
key.keyboard.keypad.memory.multiply Keypad M*
key.keyboard.keypad.memory.recall Keypad MR
key.keyboard.keypad.memory.store Keypad MS
key.keyboard.keypad.memory.subtract Keypad M-
key.keyboard.keypad.octal Keypad Octal
key.keyboard.keypad.percent Keypad %
key.keyboard.keypad.power Keypad ^
key.keyboard.keypad.right.brace Keypad }
key.keyboard.keypad.space Keypad Space
key.keyboard.keypad.tab Keypad Tab
key.keyboard.keypad.vertical.bar Keypad |
key.keyboard.keypad.xor Keypad XOR
key.keyboard.lang6 Language 6
key.keyboard.lang7 Language 7
key.keyboard.lang8 Language 8
key.keyboard.lang9 Language 9
key.keyboard.oper Oper
key.keyboard.out Out
key.keyboard.prior Prior
key.keyboard.separator Separator
key.keyboard.soft.left Soft Left This is a mobile phone button.[7]
key.keyboard.soft.right Soft Right This is a mobile phone button.[7]
key.keyboard.thousands.separator Thousands Separator
key.keyboard.world.2 # Represents "Non-US Hash", which in practice is always pointed to the same code as the ANSI backslash.

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.[8] However, the USB HID specification only permits mouse buttons from 1 to 65535,[9] 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.

On Linux, mouse buttons up to 48 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,[10] 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 16] Left Button  Left Mouse Button Yes Yes Yes
key.mouse.right[note 17] Right Button  Right Mouse Button Yes Yes Yes
key.mouse.middle[note 18] 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 Yes
key.mouse.10 Button 10  Tenth Mouse Button No Yes Yes
key.mouse.11 Button 11  Eleventh Mouse Button No Yes Yes
key.mouse.12 Button 12  Twelfth Mouse Button No Yes Yes
key.mouse.13 Button 13  Thirteenth Mouse Button No Yes Yes
key.mouse.14 Button 14  Fourteenth Mouse Button No Yes Yes
key.mouse.15 Button 15  Fifteenth Mouse Button No Yes Yes
key.mouse.16 Button 16  Sixteenth Mouse Button No Yes Yes
key.mouse.17 Button 17  Seventeenth Mouse Button No Yes Yes
key.mouse.18 Button 18  Eighteenth Mouse Button No Yes Yes
key.mouse.19 Button 19  Nineteenth Mouse Button No Yes Yes
key.mouse.20 Button 20  Twentieth Mouse Button No Yes Yes
key.mouse.21 Button 21  Twenty-First Mouse Button No Yes Yes
key.mouse.22 Button 22  Twenty-Second Mouse Button No Yes Yes
key.mouse.23 Button 23  Twenty-Third Mouse Button No Yes Yes
key.mouse.24 Button 24  Twenty-Fourth Mouse Button No Yes Yes
key.mouse.25 Button 25  Twenty-Fifth Mouse Button No Yes Yes
key.mouse.26 Button 26  Twenty-Sixth Mouse Button No Yes Yes
key.mouse.27 Button 27  Twenty-Seventh Mouse Button No Yes Yes
key.mouse.28 Button 28  Twenty-Eighth Mouse Button No Yes Yes
key.mouse.29 Button 29  Twenty-Ninth Mouse Button No Yes Yes
key.mouse.30 Button 30  Thirtieth Mouse Button No Yes Yes
key.mouse.31 Button 31  Thirty-First Mouse Button No Yes Yes
key.mouse.32 Button 32  Thirty-Second Mouse Button No Yes Yes
key.mouse.33 Button 33  Thirty-Third Mouse Button No No Yes
key.mouse.34 Button 34  Thirty-Fourth Mouse Button No No Yes
key.mouse.35 Button 35  Thirty-Fifth Mouse Button No No Yes
key.mouse.36 Button 36  Thirty-Sixth Mouse Button No No Yes
key.mouse.37 Button 37  Thirty-Seventh Mouse Button No No Yes
key.mouse.38 Button 38  Thirty-Eighth Mouse Button No No Yes
key.mouse.39 Button 39  Thirty-Ninth Mouse Button No No Yes
key.mouse.40 Button 40  Fortieth Mouse Button No No Yes
key.mouse.41 Button 41  Forty-First Mouse Button No No Yes
key.mouse.42 Button 42  Forty-Second Mouse Button No No Yes
key.mouse.43 Button 43  Forty-Third Mouse Button No No Yes
key.mouse.44 Button 44  Forty-Fourth Mouse Button No No Yes
key.mouse.45 Button 45  Forty-Fifth Mouse Button No No Yes
key.mouse.46 Button 46  Forty-Sixth Mouse Button No No Yes
key.mouse.47 Button 47  Forty-Seventh Mouse Button No No Yes
key.mouse.48 Button 48  Forty-Eighth Mouse Button No No Yes

Bedrock Edition

Keyboard codes

In Bedrock Edition, keys are stored as the decimal representation of their Windows virtual key code. This also includes platforms other than Windows, where keys are loosely mapped to these key codes.

On Android, the majority of non-basic keys are not recognized, and the Menu key is mapped to unknown (255).

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.

Multiple keys can be bound to the same action by separating their key codes with a comma in options.txt. There is not a way to do this in-game. For example, the default value in options.txt for opening the chat is 84,13, representing both T and ⏎ Return.

ID Displayed name Physical key or button Translation key
0 Unassigned Not Bound ​
3 Button3[note 19][11] ⎊ Break[note 20]
8 BACK ⌫ Backspace keyboard.keyName.backspace
9 TAB ↹ Tab keyboard.keyName.tab
12 Button12 Clear
13 RETURN ⏎ Return / ⎆ Numpad Enter 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 keyboard.keyName.pause
20 CAPITAL ⇬ Caps Lock keyboard.keyName.capsLock
21 Button21 かな Kana / 한⁄영 Han/Yeong
22 Button22 IME on
23 Button23 IME Junja
24 Button24 IME final mode
25 Button25 한자 Hanja / 英数 Eisu
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
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 ⬅︎ Back
167 Button167 ➡︎ Forward
168 Button168 🔄︎ Refresh
169 Button169 Application Stop
170 Button170 🔍︎ Search
171 Button171 Application Bookmarks
172 Button172 ⌂ 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
194 Button193 ​
194 Button194 Numpad ,
219 LBRACKET [ keyboard.keyName.lbracket
220 BACKSLASH \​ 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 ​
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
255 Button255 All unknown keys

Mouse codes

Mouse buttons are represented by negative numbers.

On Android, only 3 buttons are recognized, despite the OS supporting up to 5 buttons.

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

ID Display Description
Operating system icon for WindowsOperating system icon for ChromeOSOperating system icon for AndroidOperating system icon for iOSiPadOSOperating system icon for Amazon FireLogo for XboxLogo for Xbox One Logo for Nintendo Switch │ Logo for Nintendo Switch 2 Logo for PlayStation
Logo for PlayStation 4 Logo for 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.23a Controls can now be customized. Only keyboard buttons are recognized as valid for rebinding.
Java Edition Beta
1.8Pre-release Controls can now be bound to mouse buttons; these are handled using negative numbers.
Java Edition
1.1217w16a The first three mouse buttons are now displayed as "Left Click", "Right Click" and "Middle Click".
1.1317w43a 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.
Keys with no assigned ID are called scancode.###
Accepted values are -2147483648 to 2147483647, though obviously only a tiny subset are attainable.
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.1922w16a Controls that are not bound to anything now display "Not bound".
1.20pre2 Letter keys are now displayed in uppercase again.
pre3 Controls that are not bound to anything now display "Not Bound".
26.3snap4 Valid but undefined key codes have been changed from scancode.### to key.keyboard.###.
Removed key.keyboard.f25. Its translation string is purposefully retained in the game files for an unknown reason.[12]
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.[13]
The game now uses SDL3.
The international backslash key is now recognized as key.keyboard.world.1 on Windows, rather than key.keyboard.world.2.
key.keyboard.keypad.decimal can no longer be assigned.
key.keyboard.menu is now assigned with ⎄ Compose instead of ≣ Menu.
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 use different translation keys based on the user's operating system.
snap9 IDs and translation strings have been added for all SDL scancodes, regardless of whether or not said keycodes correspond to actual, bindable keyboard buttons:
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
key.keyboard.save renamed to key.keyboard.ac.save

Removed keys

ID Displayed name Physical key or button Translation key
key.keyboard.f25 F25 Unclear[note 23] key.keyboard.f25

Notes

  1. ↑ 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.
  2. ↑ 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 SDL is displayed instead.
  3. ↑ a b c d e f g h i j k This translation key is typically unused, but may be used with certain keyboard layouts or operating systems.
  4. ↑ This translation key could be used with certain keyboard layouts or operating systems.
  5. ↑ The "Settings" key also maps to this on Linux, for some reason: MC-310119
  6. ↑ a b c d e f g Does not bind to the correct key on some Linux systems: https://github.com/libsdl-org/SDL/pull/16239
  7. ↑ Mojang have chosen to keep this name, despite it being abbreviated in direct contrast to almost all other keys: MC-311713
  8. ↑ Linux only - only works on some systems right now, see https://github.com/libsdl-org/SDL/pull/16252
  9. ↑ Trying to bind anything to the Escape key causes it to become Not Bound instead. This can only be set by modifying options.txt.
  10. ↑ Windows only; it is assumed that KEY_KPJPCOMMA is meant to represent this on Linux, but is incorrectly bound to International 5 - see https://github.com/libsdl-org/SDL/pull/16168
  11. ↑ a b Linux only, but not assignable as the game fails to recognize key presses above ID 247: MC-311578
  12. ↑ a b c Linux only, but not assignable as the game fails to recognize key presses above ID 247: MC-311584
  13. ↑ Accidentally assignable in Linux - see MC-310984
  14. ↑ a b c Three digit number representing SDL3 key ID
  15. ↑ The translation string is assumed to match unless stated otherwise.
  16. ↑ key.mouse.1 is automatically converted to this​
  17. ↑ key.mouse.3 is automatically converted to this
  18. ↑ key.mouse.2 is automatically converted to this
  19. ↑ Displayed the same as the middle mouse button.
  20. ↑ requires Ctrl to be held before rebinding
  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.
  23. ↑ Ostensibly for a twenty-fifth function key, but Windows, Linux and presumably macOS only recognize up to F24. Some keyboards from decades past go past F24, and Arch Linux can apparently recognize up to F246, however it is unknown if Minecraft would recognize either of these.

References

  1. ↑ MC-265854
  2. ↑ MC-310108
  3. ↑ MC-266253
  4. ↑ 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 Mojang have chosen to keep the generic, non-descriptive USB HID titles for these keys, matching their internal SDL3 IDs rather than the actual real-life key names: MC-311175
  5. ↑ a b c MC-311184
  6. ↑ MC-310863
  7. ↑ a b c d https://wiki.libsdl.org/SDL3/SDL_Scancode
  8. ↑ MC-268286
  9. ↑ https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
  10. ↑ according to what karabiner-elements allows: https://discord.com/channels/647810384031645728/648555495564509184/1528136787434930358
  11. ↑ MCPE-242522
  12. ↑ MC-311176
  13. ↑ MC-310109, MC-310110
Advertisement Remove ads with Premium →

More in Gameplay

View all 133 →
Interaction rangeInteraction rangeInteraction range (also known as reach) is the maximum distance a player can interact with a block or entity and perform an action. The default…InventoryInventoryThe inventory is the pop-up menu that the player uses to manage items they carry. From this screen a player can equip armor, craft items on a 2×2 grid…Item repairItem repair is a feature that allows players to repair damaged items with durability (tools, armor, and weapons) by combining them in the crafting grid or…JumpingJumpingJumping is a form of movement that elevates the player by approximately 1.25 blocks into the air. Mobs can also jump, as part of their behavior.Knockback (mechanic)Knockback (mechanic)Knockback represents the pushback from attacks or natural causes.LanguageLanguageVarious languages outside of the system default may be selected in-game using the language menu, accessible in options‌[JE only] or settings.‌[BE only]…LightLightLight (or lighting) is a game mechanic that affects visibility, mob spawning, and the growth of some plants. There are three aspects of Minecraft's…Locator BarThe locator bar is a UI element on the player's HUD which shows the position of other players in multiplayer.
Explore the Minecraft Wiki
Blocks, items, mobs, biomes and game mechanics — all in one place.
Wiki home