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
|
Unassigned, or unrecognized[2] | key.keyboard.unknown
| ||
key.keyboard.0
|
0 | [note 2] | ||
key.keyboard.1
|
1 | [note 2] | ||
key.keyboard.2
|
2 | [note 2] | ||
key.keyboard.3
|
3 | [note 2] | ||
key.keyboard.4
|
4 | [note 2] | ||
key.keyboard.5
|
5 | [note 2] | ||
key.keyboard.6
|
6 | [note 2] | ||
key.keyboard.7
|
7 | [note 2] | ||
key.keyboard.8
|
8 | [note 2] | ||
key.keyboard.9
|
9 | [note 2] | ||
key.keyboard.a
|
A | [note 2] | ||
key.keyboard.b
|
B | [note 2] | ||
key.keyboard.c
|
C | [note 2] | ||
key.keyboard.d
|
D | [note 2] | ||
key.keyboard.e
|
E | [note 2] | ||
key.keyboard.f
|
F | [note 2] | ||
key.keyboard.g
|
G | [note 2] | ||
key.keyboard.h
|
H | [note 2] | ||
key.keyboard.i
|
I | [note 2] | ||
key.keyboard.j
|
J | [note 2] | ||
key.keyboard.k
|
K | [note 2] | ||
key.keyboard.l
|
L | [note 2] | ||
key.keyboard.m
|
M | [note 2] | ||
key.keyboard.n
|
N | [note 2] | ||
key.keyboard.o
|
O | [note 2] | ||
key.keyboard.p
|
P | [note 2] | ||
key.keyboard.q
|
Q | [note 2] | ||
key.keyboard.r
|
R | [note 2] | ||
key.keyboard.s
|
S | [note 2] | ||
key.keyboard.t
|
T | [note 2] | ||
key.keyboard.u
|
U | [note 2] | ||
key.keyboard.v
|
V | [note 2] | ||
key.keyboard.w
|
W | [note 2] | ||
key.keyboard.x
|
X | [note 2] | ||
key.keyboard.y
|
Y | [note 2] | ||
key.keyboard.z
|
Z | [note 2] | ||
key.keyboard.space
|
␣ Space | key.keyboard.space
| ||
key.keyboard.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 | 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 5] | 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.keypad.0
|
Numpad 0 | key.keyboard.keypad.0
| ||
key.keyboard.keypad.1
|
Numpad 1 | key.keyboard.keypad.1
| ||
key.keyboard.keypad.2
|
Numpad 2 | key.keyboard.keypad.2
| ||
key.keyboard.keypad.3
|
Numpad 3 | key.keyboard.keypad.3
| ||
key.keyboard.keypad.4
|
Numpad 4 | key.keyboard.keypad.4
| ||
key.keyboard.keypad.5
|
Numpad 5 | key.keyboard.keypad.5
| ||
key.keyboard.keypad.6
|
Numpad 6 | key.keyboard.keypad.6
| ||
key.keyboard.keypad.7
|
Numpad 7 | key.keyboard.keypad.7
| ||
key.keyboard.keypad.8
|
Numpad 8 | key.keyboard.keypad.8
| ||
key.keyboard.keypad.9
|
Numpad 9 | key.keyboard.keypad.9
| ||
key.keyboard.keypad.add
|
Numpad + | key.keyboard.keypad.add
| ||
key.keyboard.keypad.subtract
|
Numpad - | key.keyboard.keypad.subtract
| ||
key.keyboard.keypad.multiply
|
Numpad * | key.keyboard.keypad.multiply
| ||
key.keyboard.keypad.divide
|
Numpad / | key.keyboard.keypad.divide
| ||
key.keyboard.keypad.equal
|
Numpad = | key.keyboard.keypad.equal
| ||
key.keyboard.keypad.plus.minus
|
Numpad ± | key.keyboard.keypad.plus.minus
| ||
key.keyboard.keypad.left.parenthesis
|
Numpad ( | key.keyboard.keypad.left.parenthesis
| ||
key.keyboard.keypad.right.parenthesis
|
Numpad ) | key.keyboard.keypad.right.parenthesis
| ||
key.keyboard.keypad.period
|
Numpad . | key.keyboard.keypad.period
| ||
key.keyboard.keypad.comma
|
Numpad ,[note 6] | key.keyboard.keypad.comma
| ||
key.keyboard.keypad.enter
|
⎆ Numpad Enter | key.keyboard.keypad.enter
| ||
key.keyboard.menu
|
⎄ Compose | key.keyboard.menu
| ||
key.keyboard.application
|
≣ 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 | key.keyboard.print.screen
| ||
key.keyboard.sys.req
|
[note 7] | System Request[note 8] | key.keyboard.sys.req
| |
key.keyboard.pause
|
⎉ Pause | 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 9] | 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
| |
| macOS | ⌥ Left Option | key.keyboard.left.option
| ||
key.keyboard.right.alt
|
[3] | Windows Linux |
⌥ Right Alt | key.keyboard.right.alt
|
| macOS | ⌥ Right Option | key.keyboard.right.option
| ||
key.keyboard.left.win
|
Windows | ⊞ Left Windows | key.keyboard.left.windows
| |
| macOS | ⌘ Left Command | key.keyboard.left.command
| ||
| Linux | ◆ Left Meta | key.keyboard.left.meta
| ||
key.keyboard.right.win
|
Windows | ⊞ Right Windows | key.keyboard.right.windows
| |
| macOS | ⌘ Right Command | key.keyboard.right.command
| ||
| Linux | ◆ Right Meta | key.keyboard.right.meta
| ||
key.keyboard.lang1[4]
|
[4] | Windows/Linux | 한⁄영 Han/Yeong | key.keyboard.lang1[4]
|
| macOS | かな Kana | |||
key.keyboard.lang2[4]
|
[4] | Windows/Linux | 한자 Hanja | key.keyboard.lang2[4]
|
| macOS | 英数 Eisu | |||
key.keyboard.lang3[4]
|
[4] | Katakana | key.keyboard.lang3[4]
| |
key.keyboard.lang4[4]
|
[4] | Hiragana | key.keyboard.lang4[4]
| |
key.keyboard.lang5[4]
|
[4] | 全角⁄半角 Zenkaku/Hankaku[note 6] | key.keyboard.lang5[4]
| |
key.keyboard.international1[4]
|
[4] | ろ (JIS) / / (ABNT) | key.keyboard.international1[4]
| |
key.keyboard.international2[4]
|
[4] | Katakana/Hiragana | key.keyboard.international2[4]
| |
key.keyboard.international3[4]
|
[4] | ¥ | key.keyboard.international3[4]
| |
key.keyboard.international4[4]
|
[4] | 変換 Henkan | key.keyboard.international4[4]
| |
key.keyboard.international5[4]
|
[4] | 無変換 Muhenkan | key.keyboard.international5[4]
| |
key.keyboard.international6[5]
|
[5] | Numpad , (PC-9800)[note 10] | key.keyboard.international6[5]
| |
key.keyboard.mute
|
🔇︎ Mute | key.keyboard.mute
| ||
key.keyboard.volume.down
|
🔉︎ Volume Down | key.keyboard.volume.down
| ||
key.keyboard.volume.up
|
🔊︎ Volume Up | key.keyboard.volume.up
| ||
key.keyboard.media.play.pause
|
⏯︎ Play/Pause | key.keyboard.media.play.pause
| ||
key.keyboard.media.play
|
▶︎ Play | key.keyboard.media.play
| ||
key.keyboard.media.pause
|
⏸︎ Pause | key.keyboard.media.pause
| ||
key.keyboard.media.record
|
⏺︎ Record | key.keyboard.media.record
| ||
key.keyboard.media.fast.forward
|
⏩︎ Fast Forward | key.keyboard.media.fast.forward
| ||
key.keyboard.media.rewind
|
⏪︎ Rewind | key.keyboard.media.rewind
| ||
key.keyboard.media.next.track
|
⏭︎ Next Track | key.keyboard.media.next.track
| ||
key.keyboard.media.previous.track
|
⏮︎ Previous Track | key.keyboard.media.previous.track
| ||
key.keyboard.media.stop
|
⏹︎ Stop | key.keyboard.media.stop
| ||
key.keyboard.media.eject
|
⏏︎ Eject | key.keyboard.media.eject
| ||
key.keyboard.media.select
|
Media Select | key.keyboard.media.select
| ||
key.keyboard.stop
|
Stop[note 6] | key.keyboard.stop
| ||
key.keyboard.cancel
|
Cancel | key.keyboard.cancel
| ||
key.keyboard.cut
|
Cut | key.keyboard.cut
| ||
key.keyboard.copy
|
Copy | key.keyboard.copy
| ||
key.keyboard.paste
|
Paste | key.keyboard.paste
| ||
key.keyboard.undo
|
⎌ Undo | key.keyboard.undo
| ||
key.keyboard.again
|
Redo[6] | key.keyboard.again
| ||
key.keyboard.ac.new
|
📄 New | key.keyboard.ac.new
| ||
key.keyboard.ac.open
|
📂 Open | key.keyboard.ac.open
| ||
key.keyboard.ac.save
|
💾 Save | key.keyboard.ac.save
| ||
key.keyboard.help
|
Help | key.keyboard.help
| ||
key.keyboard.find
|
Find | key.keyboard.find
| ||
key.keyboard.ac.close
|
Application Close | key.keyboard.ac.close
| ||
key.keyboard.ac.exit
|
Application Exit[note 6] | key.keyboard.ac.exit
| ||
key.keyboard.ac.stop
|
Application Stop | key.keyboard.ac.stop
| ||
key.keyboard.ac.properties
|
Application Properties[note 6] | key.keyboard.ac.properties
| ||
key.keyboard.ac.search
|
🔍︎ Search | key.keyboard.ac.search
| ||
key.keyboard.ac.home
|
⌂ Home | key.keyboard.ac.home
| ||
key.keyboard.ac.back
|
⬅︎ Back | key.keyboard.ac.back
| ||
key.keyboard.ac.forward
|
➡︎ Forward | key.keyboard.ac.forward
| ||
key.keyboard.ac.refresh
|
🔄︎ Refresh | key.keyboard.ac.refresh
| ||
key.keyboard.ac.bookmarks
|
Application Bookmarks | key.keyboard.ac.bookmarks
| ||
key.keyboard.power
|
⏻ Power | key.keyboard.power
| ||
key.keyboard.sleep
|
⏾ Sleep | key.keyboard.sleep
| ||
key.keyboard.wake
|
Wake[note 6] | key.keyboard.wake
| ||
key.keyboard.alternate.erase
|
[note 6] | key.keyboard.alternate.erase
| ||
key.keyboard.channel.down
|
[note 11] | key.keyboard.channel.down
| ||
key.keyboard.channel.up
|
[note 11] | key.keyboard.channel.up
| ||
key.keyboard.clear
|
[note 12] | key.keyboard.clear
| ||
key.keyboard.mode
|
[note 12][note 13] | key.keyboard.mode
| ||
key.keyboard.select
|
[note 12] | key.keyboard.select
| ||
key.keyboard.[note 14]
|
[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
|
||
key.keyboard.call
|
This is a mobile phone button.[7] | |
key.keyboard.clear.again
|
||
key.keyboard.crsel
|
||
key.keyboard.currency.subunit
|
||
key.keyboard.currency.unit
|
||
key.keyboard.decimal.separator
|
||
key.keyboard.end.call
|
This is a mobile phone button.[7] | |
key.keyboard.enter2
|
||
key.keyboard.execute
|
||
key.keyboard.exsel
|
||
key.keyboard.international7
|
||
key.keyboard.international8
|
||
key.keyboard.international9
|
||
key.keyboard.keypad.00
|
||
key.keyboard.keypad.000
|
||
key.keyboard.keypad.a
|
||
key.keyboard.keypad.ampersand
|
||
key.keyboard.keypad.at
|
||
key.keyboard.keypad.b
|
||
key.keyboard.keypad.backspace
|
||
key.keyboard.keypad.binary
|
||
key.keyboard.keypad.c
|
||
key.keyboard.keypad.clear
|
||
key.keyboard.keypad.clear.entry
|
||
key.keyboard.keypad.colon
|
||
key.keyboard.keypad.d
|
||
key.keyboard.keypad.decimal
|
||
key.keyboard.keypad.double.ampersand
|
||
key.keyboard.keypad.double.vertical.bar
|
||
key.keyboard.keypad.e
|
||
key.keyboard.keypad.equals.as400
|
||
key.keyboard.keypad.exclamation
|
||
key.keyboard.keypad.f
|
||
key.keyboard.keypad.greater
|
||
key.keyboard.keypad.hash
|
||
key.keyboard.keypad.hexadecimal
|
||
key.keyboard.keypad.left.brace
|
||
key.keyboard.keypad.less
|
||
key.keyboard.keypad.memory.add
|
||
key.keyboard.keypad.memory.clear
|
||
key.keyboard.keypad.memory.divide
|
||
key.keyboard.keypad.memory.multiply
|
||
key.keyboard.keypad.memory.recall
|
||
key.keyboard.keypad.memory.store
|
||
key.keyboard.keypad.memory.subtract
|
||
key.keyboard.keypad.octal
|
||
key.keyboard.keypad.percent
|
||
key.keyboard.keypad.power
|
||
key.keyboard.keypad.right.brace
|
||
key.keyboard.keypad.space
|
||
key.keyboard.keypad.tab
|
||
key.keyboard.keypad.vertical.bar
|
||
key.keyboard.keypad.xor
|
||
key.keyboard.lang6
|
||
key.keyboard.lang7
|
||
key.keyboard.lang8
|
||
key.keyboard.lang9
|
||
key.keyboard.oper
|
||
key.keyboard.out
|
||
key.keyboard.prior
|
||
key.keyboard.separator
|
||
key.keyboard.soft.left
|
This is a mobile phone button.[7] | |
key.keyboard.soft.right
|
This is a mobile phone button.[7] | |
key.keyboard.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]
|
Yes | Yes | Yes | ||
key.mouse.right[note 17]
|
Yes | Yes | Yes | ||
key.mouse.middle[note 18]
|
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 | Yes | ||
key.mouse.10
|
No | Yes | Yes | ||
key.mouse.11
|
No | Yes | Yes | ||
key.mouse.12
|
No | Yes | Yes | ||
key.mouse.13
|
No | Yes | Yes | ||
key.mouse.14
|
No | Yes | Yes | ||
key.mouse.15
|
No | Yes | Yes | ||
key.mouse.16
|
No | Yes | Yes | ||
key.mouse.17
|
No | Yes | Yes | ||
key.mouse.18
|
No | Yes | Yes | ||
key.mouse.19
|
No | Yes | Yes | ||
key.mouse.20
|
No | Yes | Yes | ||
key.mouse.21
|
No | Yes | Yes | ||
key.mouse.22
|
No | Yes | Yes | ||
key.mouse.23
|
No | Yes | Yes | ||
key.mouse.24
|
No | Yes | Yes | ||
key.mouse.25
|
No | Yes | Yes | ||
key.mouse.26
|
No | Yes | Yes | ||
key.mouse.27
|
No | Yes | Yes | ||
key.mouse.28
|
No | Yes | Yes | ||
key.mouse.29
|
No | Yes | Yes | ||
key.mouse.30
|
No | Yes | Yes | ||
key.mouse.31
|
No | Yes | Yes | ||
key.mouse.32
|
No | Yes | Yes | ||
key.mouse.33
|
No | No | Yes | ||
key.mouse.34
|
No | No | Yes | ||
key.mouse.35
|
No | No | Yes | ||
key.mouse.36
|
No | No | Yes | ||
key.mouse.37
|
No | No | Yes | ||
key.mouse.38
|
No | No | Yes | ||
key.mouse.39
|
No | No | Yes | ||
key.mouse.40
|
No | No | Yes | ||
key.mouse.41
|
No | No | Yes | ||
key.mouse.42
|
No | No | Yes | ||
key.mouse.43
|
No | No | Yes | ||
key.mouse.44
|
No | No | Yes | ||
key.mouse.45
|
No | No | Yes | ||
key.mouse.46
|
No | No | Yes | ||
key.mouse.47
|
No | No | Yes | ||
key.mouse.48
|
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
|
Not Bound | | |
3
|
[note 19][11] | ⎊ Break[note 20] | |
8
|
⌫ Backspace | keyboard.keyName.backspace
| |
9
|
↹ Tab | keyboard.keyName.tab
| |
12
|
Clear | ||
13
|
⏎ Return / ⎆ Numpad Enter | 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 | keyboard.keyName.pause
| |
20
|
⇬ Caps Lock | keyboard.keyName.capsLock
| |
21
|
かな Kana / 한⁄영 Han/Yeong | ||
22
|
IME on | ||
23
|
IME Junja | ||
24
|
IME final mode | ||
25
|
한자 Hanja / 英数 Eisu | ||
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 | ||
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
|
⬅︎ Back | ||
167
|
➡︎ Forward | ||
168
|
🔄︎ Refresh | ||
169
|
Application Stop | ||
170
|
🔍︎ Search | ||
171
|
Application Bookmarks | ||
172
|
⌂ 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
| |
194
|
| ||
194
|
Numpad , | ||
219
|
[ | keyboard.keyName.lbracket
| |
220
|
\ | 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
|
| ||
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 | ||
255
|
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
|
||
-98
|
||
-97
|
||
-95
|
||
-94
|
Controller codes
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.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. | |||||||
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.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". | ||||||
| 26.3 | snap4 | 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
|
Unclear[note 23] | key.keyboard.f25
| ||
Notes
- ↑ 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.
- ↑ 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.
- ↑ 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.
- ↑ This translation key could be used with certain keyboard layouts or operating systems.
- ↑ The "Settings" key also maps to this on Linux, for some reason: MC-310119
- ↑ 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
- ↑ Mojang have chosen to keep this name, despite it being abbreviated in direct contrast to almost all other keys: MC-311713
- ↑ Linux only - only works on some systems right now, see https://github.com/libsdl-org/SDL/pull/16252
- ↑ Trying to bind anything to the Escape key causes it to become Not Bound instead. This can only be set by modifying options.txt.
- ↑ 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
- ↑ a b Linux only, but not assignable as the game fails to recognize key presses above ID 247: MC-311578
- ↑ a b c Linux only, but not assignable as the game fails to recognize key presses above ID 247: MC-311584
- ↑ Accidentally assignable in Linux - see MC-310984
- ↑ a b c Three digit number representing SDL3 key ID
- ↑ The translation string is assumed to match unless stated otherwise.
- ↑
key.mouse.1is automatically converted to this - ↑
key.mouse.3is automatically converted to this - ↑
key.mouse.2is automatically converted to this - ↑ Displayed the same as the middle mouse button.
- ↑ requires Ctrl to be held before rebinding
- ↑ 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.
- ↑ 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
- ↑ MC-265854
- ↑ MC-310108
- ↑ MC-266253
- ↑ 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
- ↑ a b c MC-311184
- ↑ MC-310863
- ↑ a b c d https://wiki.libsdl.org/SDL3/SDL_Scancode
- ↑ 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
- ↑ MCPE-242522
- ↑ MC-311176
- ↑ MC-310109, MC-310110

