The bug
If you're using a keyboard layout where the letter A is not on the same position as on a QUERTY keyboard (for example, the French AZERTY layout), Minecraft still maps keybindings as if you were using a US/QUERTY keyboard.
How to reproduce
Select the French AZERTY keyboard layout (other keyboard layouts are affected as well, see above).
Type something into the chat.
Press
Ctrl
+A
(whereA
is the key directly to the right of the tab key).Note that nothing happens.
Press
Ctrl
+Q
(whereQ
is the key directly to the right of the CAPS LOCK key).Note that the text you typed into the chat is being selected.
Other keybindings are affected as well, for example F3
+Q
and F3
+A
. This also applies to Mac where for example Command
+A
is expected to select all text, but quits the app instead.
Code analysis
This is caused by the method glfwSetKeyCallback who returns a key code assuming a US keyboard layout.
To fix it, instead of directly testing the key code returned by glfwSetKeyCallback with the GLFW_KEY constants, it has to be converted to his printable character with the glfwGetKeyName method.
– @unknown in this comment
Linked issues
is duplicated by 43
relates to 3
Comments 99
Just to be sure, do you rather mean CTRL+A in the title?
Otherwise I can also confirm that using CTRL+A to select text isn't working, and I have to use CTRL+Q instead.
The F3+A and F3+Q shorcuts are also affected and thefore swapped out.
It seems to be caused by the use of an azerty keyboard in my case
Confirmed even more by digging a bit :
This is caused by the method glfwSetKeyCallback who returns a key code assuming a US keyboard layout.
To fix it, instead of directly testing the key code returned by glfwSetKeyCallback with the GLFW_KEY constants, it has to be converted to his printable character with the glfwGetKeyName method.
Works for me (Windows 10, idk if it matters)
Make sure the text field is actually selected.