I can confirm the issue still occurs on 1.18.1. It is very iritating and makes typing in chat in a language that requires using the Alt Gr key often very difficult. I can provide some more information on the subject:
I can confirm pressing left control or clicking outside the Minecraft window usually fixes the problem.
In my experience, the bug can be much more difficult to reproduce while debugging.
I have a very fast computer with a consistantly high framerate, so low FPS isn't nessecarily a factor.
It seems the issue doesn't nessecarily happen to everyone, however, it's definitely required to use a keyboard layout that uses the Alt Gr key (In my case I'm using the Polish (programmer) keyboard layout).
The two easiest ways I found to trigger the bug are the following: (The recodring software I use sees pressing Alt Gr as pressing right alt and left control at the same time) 1. In the chat text box, simultaneously spam the letter 'a' and Alt Gr on your keyboard as hard as you can. This will result in the text box occassionally entering a state where the box behaves as if control was continually pressed (meaning backspace deletes whole words, the letter 'a' deletes the entire text and adds an 'a' at the end, and the arrow keys move the cursor in the same way as if control is pressed) (demonstration: https://youtu.be/ujnOdIAE8vY) 2. Walk (don't sprint) and spam the Alt Gr key. This will cause the player to start sprinting (demonstration: https://youtu.be/IOJipEcblkc)
The issue (at least in the case of text fields, not necessarily for example 2. that I gave previously) seems to come from the fact that while the bug is active, GLFW.glfwGetKey for GLFW.GLFW_KEY_LEFT_CONTROL returns 1, even when no alt or control keys are pressed on the keyboard (At this time, GLFW.glfwGetKey for GLFW.GLFW_KEY_RIGHT_ALT and GLFW.GLFW_MOD_ALT both return 0).
I can confirm the issue still occurs on 1.18.1. It is very iritating and makes typing in chat in a language that requires using the Alt Gr key often very difficult. I can provide some more information on the subject:
I can confirm pressing left control or clicking outside the Minecraft window usually fixes the problem.
In my experience, the bug can be much more difficult to reproduce while debugging.
I have a very fast computer with a consistantly high framerate, so low FPS isn't nessecarily a factor.
It seems the issue doesn't nessecarily happen to everyone, however, it's definitely required to use a keyboard layout that uses the Alt Gr key (In my case I'm using the Polish (programmer) keyboard layout).
The two easiest ways I found to trigger the bug are the following:
(The recodring software I use sees pressing Alt Gr as pressing right alt and left control at the same time)
1. In the chat text box, simultaneously spam the letter 'a' and Alt Gr on your keyboard as hard as you can. This will result in the text box occassionally entering a state where the box behaves as if control was continually pressed (meaning backspace deletes whole words, the letter 'a' deletes the entire text and adds an 'a' at the end, and the arrow keys move the cursor in the same way as if control is pressed) (demonstration: https://youtu.be/ujnOdIAE8vY)
2. Walk (don't sprint) and spam the Alt Gr key. This will cause the player to start sprinting (demonstration: https://youtu.be/IOJipEcblkc)
The issue (at least in the case of text fields, not necessarily for example 2. that I gave previously) seems to come from the fact that while the bug is active, GLFW.glfwGetKey for GLFW.GLFW_KEY_LEFT_CONTROL returns 1, even when no alt or control keys are pressed on the keyboard (At this time, GLFW.glfwGetKey for GLFW.GLFW_KEY_RIGHT_ALT and GLFW.GLFW_MOD_ALT both return 0).
I have created a temporary and hacky fix for the bug in the form of a fabric mod for anyone else that is iritated by this: https://github.com/MikolajKolek/fix-alt-gr