This ticket is intended as the successor to MC-127939 and MC-170376 due to 26.3's switch to SDL3 from GLFW for input handling, as there have been considerable behavioural changes resulting from this.
Non-media keys are listed at MC-310944. Power-related keys are listed at MC-310991.
When attempting to bind multimedia controls to Minecraft game actions, a raw translation string is displayed consisting of “key.keyboard.” followed by a three-digit number. The presence of a translation string, rather than a proper name, for these keys indicates a bug, as internal strings like these should never be exposed in this manner.
To reproduce, if you have a multimedia keyboard, this should be as simple as trying to bind game controls to the extra buttons as though they were standard keyboard keys. If you only have a standard keyboard with no bonus buttons, or wish to try more buttons not present on your own keyboard, I have attached a script that can be used to emulate key presses. To run this script (Linux only):
download the attached script and put it in a folder somewhere
from within this folder, open a terminal window
run the following command (replace both instances of 161 with any of the numbers in the left column of the list at the end of this ticket): ./simulate-keys 'sleep 2' 'press 161' 'sleep 0.1' 'release 161
within 2 seconds, click on one of the rebindable buttons in the key binds menu in Minecraft
Expected results: these keys would have proper names in-game.
Actual results: instead of those keys' actual names, raw translation strings are displayed.
A list of evdev key IDs I’ve tried that are affected by this issue (left is the input number representing the evdev numeric ID, center is the number displayed in-game, right is the name of the key in evdev):
number : key.keyboard.NUMBER (evdev key name for leftmost number)
128 : 155 (KEY_STOP)
161 : 270 (KEY_EJECTCD)
162 : 270 (KEY_EJECTCLOSECD)
163 : 267 (KEY_NEXTSONG)
165 : 268 (KEY_PREVIOUSSONG)
166 : 269 (KEY_STOPCD)
167 : 264 (KEY_RECORD)
168 : 266 (KEY_REWIND)
200 : 262 (KEY_PLAYCD)
201 : 263 (KEY_PAUSECD)
207 : 262 (KEY_PLAY)
208 : 265 (KEY_FASTFORWARD)
223 : 155 (KEY_CANCEL)
226 : 272 (KEY_MEDIA)
Attachments
Comments 8
More or less, basically everything that has a defined SDL scancode https://wiki.libsdl.org/SDL3/SDL_Scancode should have a translation.
The keys with this effect are explicitly mapped to named SDL key codes, but Minecraft doesn't give them proper IDs, resulting in this issue: https://github.com/libsdl-org/SDL/blob/855cbec702f246661ff00a0bce9e0683012840c2/src/events/scancodes_linux.h
As of 26.3 snapshot 7 the following keys are no longer bound to untranslated strings and have proper IDs instead:
key.keyboard.127 (becomes key.keyboard.mute)
key.keyboard.129 (becomes key.keyboard.volume.down)
key.keyboard.128 (becomes key.keyboard.volume.up)
key.keyboard.122 (becomes key.keyboard.undo)
key.keyboard.121 (becomes key.keyboard.again)
key.keyboard.124 (becomes key.keyboard.copy)
key.keyboard.125 (becomes key.keyboard.paste)
key.keyboard.117 (becomes key.keyboard.help)
key.keyboard.123 (becomes key.keyboard.cut)
key.keyboard.126 (becomes key.keyboard.find)
key.keyboard.271 (becomes key.keyboard.media.play.pause)
key.keyboard.273 (becomes key.keyboard.new)
key.keyboard.277 (becomes key.keyboard.save)
The rest are still affected by this issue.
I’ve moved the ten non-media keys to a separate ticket: MC-310944
Power management keys moved to MC-310991
Application control keys moved to MC-311010
Thank you for helping us improve Minecraft! We saved your files: