Minecraft:Key codes
More actions
Template:For This is a list of key codes used by Minecraft:Minecraft, which are used in configuration files such as the Minecraft:options.txt file in the Minecraft directory.Template:Info needed
Java Edition
Keyboard codes
The displayed names of several keys will change depending on the currently active system keyboard layout. The values displayed in this table assume standard en-US.
| Value | In-game name | Description |
|---|---|---|
| key.keyboard.apostrophe | ' | |
| key.keyboard.backslash | \ | |
| key.keyboard.comma | , | |
| key.keyboard.equal | = | |
| key.keyboard.grave.accent | ` | |
| key.keyboard.left.bracket | [ | |
| key.keyboard.minus | - | |
| key.keyboard.period | . | |
| key.keyboard.right.bracket | ] | |
| key.keyboard.semicolon | ; | |
| key.keyboard.slash | / | |
| key.keyboard.space | Space | |
| key.keyboard.tab | Tab | |
| key.keyboard.left.alt | Windows/Linux: Left Alt macOS: Left OptionTemplate:Upcoming | |
| key.keyboard.left.control | Left Control | |
| key.keyboard.left.shift | Left Shift | |
| key.keyboard.left.win | Windows: Left Win Linux: Left MetaTemplate:Upcoming macOS: Left CommandTemplate:Upcoming | |
| key.keyboard.right.alt | Windows/Linux: Right Alt macOS: Right OptionTemplate:Upcoming | |
| key.keyboard.right.control | Right Control | |
| key.keyboard.right.shift | Right Shift | |
| key.keyboard.right.win | Windows: Right Win Linux: Right MetaTemplate:Upcoming macOS: Right CommandTemplate:Upcoming | |
| key.keyboard.enter | Enter | |
| key.keyboard.escape | Escape | |
| key.keyboard.backspace | Backspace | |
| key.keyboard.delete | Delete | |
| key.keyboard.end | End | |
| key.keyboard.home | Home | |
| key.keyboard.insert | Insert | |
| key.keyboard.page.down | Page Down | |
| key.keyboard.page.up | Page Up | |
| key.keyboard.pause | Pause | |
| key.keyboard.applicationTemplate:Upcoming | Menu | |
| key.keyboard.menu | Menu | |
| key.keyboard.print.screen | Print Screen | |
| key.keyboard.world.1 | World 1 | Template:Info needed |
| key.keyboard.world.2 | World 2 | Template:Info needed |
| key.keyboard.muteTemplate:Upcoming | Mute | |
| key.keyboard.volume.upTemplate:Upcoming | Volume Up | |
| key.keyboard.volume.downTemplate:Upcoming | Volume Down | |
| key.keyboard.media.play.pauseTemplate:Upcoming | Play/Pause | |
| key.keyboard.stopTemplate:Upcoming | Stop | |
| key.keyboard.againTemplate:Upcoming | Again | |
| key.keyboard.undoTemplate:Upcoming | Undo | |
| key.keyboard.cutTemplate:Upcoming | Cut | |
| key.keyboard.copyTemplate:Upcoming | Copy | |
| key.keyboard.pasteTemplate:Upcoming | Paste | |
| key.keyboard.findTemplate:Upcoming | Find | |
| key.keyboard.helpTemplate:Upcoming | Help | |
| key.keyboard.newTemplate:Upcoming | New | |
| key.keyboard.saveTemplate:Upcoming | Save | |
| scancode.###Template:Until | scancode.### | Untranslated |
| key.keyboard.###Template:Upcoming | key.keyboard.### | Untranslated |
Mouse codes
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.
Mouse buttons are handled as a signed 32-bit integer, meaning that through editing options.txt, values from Template:Code to Template:Code can be specified without being rejected by the game as invalid.<ref>Template:Bug</ref> However, the USB HID specification only permits mouse buttons from 1 to 65535,<ref>https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf</ref> 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.Template:Until
On Linux, mouse buttons up to 48Template:Upcoming 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, 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.
Bedrock Edition
Keyboard codes
In Template:BE, keys are stored as the value of their virtual key code.
Mouse codes
Mouse buttons are represented by negative numbers.Template:Info needed
| ID | Displayed name | Description |
|---|---|---|
| Template:Code | Button1 | Left Mouse Button |
| Template:Code | Button2 | Right Mouse Button |
| Template:Code | Button3 | Middle Mouse Button |
| Template:Code | Button5 | Mouse Button 5 |
| Template:Code | Button6 | Mouse Button 6 |
Controller codes
History
Java Edition
Notes
References
Template:Navbox Java Edition technical Template:Navbox Bedrock Edition
Minecraft:fr:Codes de touche Minecraft:hu:Billentyűkódok Minecraft:ja:キーコード Minecraft:nl:Toetscodes Minecraft:pt:Códigos de teclas Minecraft:ru:Коды клавиш Minecraft:uk:Коди клавіш Minecraft:zh:键控代码