mojira.dev
MC-122421

On Linux, simultaneously pressing two keys introduces a delay for one of the keys pressed

When pressing two or more keys on the same frame/tick, one of them will only be considered pressed after a delay specified by xset r rate. Pressing another key while this delay happens entirely drops the key to be pressed.

This breaks sprinting, walking diagonally, and jumping forward.

Workaround: set the XMODIFIERS environment variable to "@im=null", or "@im=xim".

Fix:
1) apply the patch from here to the 3.2.2 source tree, and compile it (thanks, #comment-608172)
2) add -Dorg.lwjgl.librarypath="/path/to/library/" to the launcher options (write the folder it's in, not the .so file itself)

If you do not want to bother with recompiling glfw, I have a precompiled binary for arch linux at https://i.selic.re/libglfw.so
(If a mod can confirm there's no malicious edits, that would be nice!)

Related issues

Attachments

Comments

migrated
[media][media]
seeker3000

It might be you computer try checking somethings out and see if you can fix it cause it works fine for me.
EDIT:Then again i'm on Win. 10

[Mod] Neko

Also cannot reproduce on Windows 10.

migrated

Can't seem to be able to reproduce this on windows 10 either, so I am assuming this is a linux-only bug. It is fixable by setting the key repeat settings to repeat all keys after 1ms, but that kinda breaks everything else on the system.

Fry
TheDoctorLink

I can confirm that this happens on Linux, and not on Windows

migrated

For me this issue only occurs on my external keyboard in 1.13 My laptop keyboard seems to be able to send the multiple keypresses at the same time. And no it's not the keyboard, the keyboard works fine in 1.12.2

migrated

1.13.1 also has this issue. Is this just a problem of the library not being updated to the latest on Linux? Or is this directly to do with the Linux version of Minecraft?

migrated

It's the library that was linked by Georgii - GLFW. It seems that Minecraft updated from LWJGL 2 to LWJGL 3, and the latter uses GLFW whereas the former doesn't. Right now it isn't fixed.

Honestly I might take a crack at debugging it later today, this is a really annoying bug that I'm afraid won't be fixed for a while due to the low amount of players experiencing the bug.

migrated

So if I could be of any assistance would it be by making a patch to GLFW because it doesn't have some component? Or is the minecraft code to read key-presses just wrong for linux?

migrated

It would be GLFW as far as I can tell. Although for some reason I was unable to replicate the bug using the code here.

migrated

Can confirm: This happens on Linux and makes parkour obnoxiously difficult.

migrated

Still no solve after many weeks? i really cant play at all

migrated

when you have `xset r off` you dont even have rate delay too, you just cant press two keys at same time

migrated

Still exists on 1.13.2

migrated

I am running Linux and experiencing the same issue, it is really annoying!

migrated

Happen on Ubuntu 18.10 and MC 1.13.2 too ! Very annoying !

migrated

For anyone still looking for a workaround, using

$ export XMODIFIERS="@im=null"

fixed it for me. Note that this may end up with you having even more input issues, but it does seem to work.

 

migrated

@hyper, where does this line go? I see references to XMODIFIERS on some help forums but it doesn't seem clear to me where to place this line. Thanks for the help. (I'd be curious what input issues it can cause as well.)

migrated

@Roescoe Wild: This is an environment variable; some display environments may support starting an application with it set (you certainly don't wanna do this for every application), but the most portable way is to simply open a terminal, paste that line there, and run minecraft from the location you have it installed in. You can make that a shell script, which is a file with e.g.

#!/bin/sh
export XMODIFIERS="@im=null"
/path/to/launcher

Protip: if you see a $ at the beginning of the line, it indicates that you should be running this in a terminal. Same for #, but as a superuser.

migrated

Oh huh, but I could theoretically set it globally, (I assume this is where the issues would come up) I wondered if it would come to scripts though.

It was hard for me to find the current launcher as it isn't in the .minecraft folder (the old one is though). For others wondering the path I found was "/opt/minecraft-launcher/launcher" (you all can add that to your list of places to search)

And YES! it works. Thanks many times over Selicre.

migrated

I found a major problem with the work around, which I didn't realize was related. When attempting to select all (ctrl a) it deletes all the text and does not copy it, it also adds an "a". Since there is no other way to select text, text is unselectable with this workaround. Please give us a real fix Mojang.

migrated

@Roescoe Wild: you can select text with shift+home while at the end of the line, and iirc copy/paste with ctrl+/shift+insert.

migrated

@Selicre: Thanks, that shift+home does appear to work, though the copying seems to require ctrl c (which is identical to ctrl x) and pasting is shift+insert.

 

I guess that's basically saying go to home while I hold shift. I'm glad to have it documented here for others who are confused. Not sure if there's any hope for this bug to be fixed. Sadly it is still present in the latest snapshot.

migrated

@Roescoe Wild You can use SHIFT + LEFT or RIGHT arrow keys to select text. CTRL+C works on my computer, CTRL+V too. CTRL+A is not working.

When you paste text wit CTRL+V il paste "<text>v" but just remove the trailing "v" and you're done.

migrated

@Florent Yeah Ctrl V works for me with deleting the trailing v. It is very interesting that CTRL+C works for you. I wonder why that's inconsistent.

TheDoctorLink

This doesn't seem to occur on my PC anymore (using 1.14.2)

migrated

Can confirm it still happens in 1.14.2 and 1.14.3 if I don't launch it with the script.

brottweiler

I have this issue on 1.14.4, running on Archlinux. I got a new keyboard recently and started noticing these issues, and I thought there was an issue with the keyboard at first. I didn't notice this bug on my old keyboard for some reason, at least not as profound as I do now.. It's very annoying and difficult to play with this bug and I am going to accidentally run off a bridge or something ingame due to it lol.

brottweiler

Still unresolved as of 1.15-pre1.

migrated

WORKAROUND:
There's a fix coming down the pipeline for glfw potentially; in the corresponding issue in their tracker is this link https://github.com/glfw/glfw/pull/1472/files#diff-0f3106b1408d89cbecbe2f57a783331bR1265
it leads to a fix which describes what lines to change and how in order to resolve this bug as well as the issue that caused it in the first place. If you feel like compiling your own libraries to restore your ability to enjoy parkour and pvp, then that's the solution.

migrated

I am experiencing this too, with a USB keyboard and Debian testing on kernel 5.3. I understand Linux is not a large user base, but frankly it seems like it would be hard not to catch a significant bug like this with even minimal testing. I hope someone can resolve this (I guess more likely to be the GLFW maintainers than Mojang), because the workaround is a bit of a pain.

migrated

Affects 1.15.2 & 20w08a.

migrated

It also happens on my laptop, but not with the builtin keyboard, only with a USB external one.

migrated

Correct that's what this bug is about.

migrated

I have attached my video with this bug as well(keystrokes visible on screen).

I also tested it on 2 different PCs using 3 different keyboards. Both computers are running Linux on Kernel 5.4

migrated

The same exact thing is happening to me on Minecraft. I have to run Linux instead of Windows 10 because my GPU is a potato (plus Windows 10 sucks up lots of GPU just to be able to work) and I'm too broke to buy a better one. Please help, Mojang, I really like Java Edition and I want to be able to enjoy your game properly 😞

P.S. I'm also too afraid to fix my client myself with the fix that was suggested by the reporter because I have very minimal knowledge when it comes to Java and I don't wanna break the game.

brottweiler

It's easy enough to do. I got the compiled file, made a new folder called .minecraft/glfw and put it in there. Then added -Dorg.lwjgl.librarypath="/home/brott/.minecraft/glfw" at the end of the launch options.

migrated

This seems to be fixed in 1.16, can anyone confirm?

brottweiler

Not fixed in 1.16.

brottweiler

Should be fixed upstream here https://github.com/glfw/glfw/commit/9a3664b4a992a5a9b669179098542b0f882dece7

But Minecraft has to use an updated version as well afaik.

migrated

Could someone do a step by step tutorial on how to fix this? It would be greatly appreciated!

migrated

@Alan Klas
There are a few methods which seem to work for some people. None of them are fixes, they are workarounds, besides the one which updates lwjgl.

This fix requires you have set the parameters in your "launch options" tab in the launcher for the specific 1.13+ version to point to the path where the updated version is. Here is my JVM arguments which I use for 1.16.1:

-XX:+UseG1GC -Xmx4G -Xms3G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:-UseAdaptiveSizePolicy -Dorg.lwjgl.librarypath="/home/[user]/myLibrary"

The folder myLibrary in my case has the files:

libglfw.conf (this file just has the path of the folder which is "home/[user]/myLibrary" you can create a file like this in a text editor such as "Sublime" or "Text Editor" on ubuntu)

libglfw.so (this file is downloaded here: https://i.selic.re/libglfw.so )

I did not give any new information not already in this post, so please do take the time to read through it and thank the people who put it together.

migrated

Hi @Alan Klas and everyone interested,

I've recorded video tutorial on how to workaround this issue. Video is on YouTube, just search for issue number "MC-122421" and it should appear.

Cheers

migrated

Hello!

This bug affects me. I use a laptop with an additional USB keyboard (which is affected by described problem). Laptop built-in keyboard works fine.

Fully updated Kubuntu 20.04.01 LTS

Minecraft: 1.16.3

Java: 1.8.0_265 64 bit

Manually replacing libglfw.so in .minecraft/versions/*/natives/ with provided one (and removing libglfw.so.git, libglfw.so.sha1 files) fixed the issue for me.

migrated

I'm having trouble using the workaround with the 2.1.16102 launcher

I put the pre-compiled libglfw.so from the OP in /home/ben/.minecraft/lwjgl-override, and added -Dorg.lwjgl.librarypath=/home/ben/.minecraft/lwjgl-override to my jvm args. But when I start the game, I get an error in the game output:

[STDERR]: [LWJGL] [ERROR] Incompatible Java and native library versions detected.
Possible reasons:
	a) -Djava.library.path is set to a folder containing shared libraries of an older LWJGL version.
	b) The classpath contains jar files of an older LWJGL version.
Possible solutions:
	a) Make sure to not set -Djava.library.path (it is not needed for developing with LWJGL 3) or make
	   sure the folder it points to contains the shared libraries of the correct LWJGL version.
	b) Check the classpath and make sure to only have jar files of the same LWJGL version in it.
Backend library: LWJGL version 3.2.2 build 10

The bug still happens when I play, so it seems like it's not using the patched libglfw isn't being used. Am I doing something wrong?

I also don't have a natives folder in .minecraft/version/1.16.3/, so I can't try what @semjon00 suggested

Arisa Bot

An attachment with a disallowed file extension has been removed from this ticket.

Executable files and documents are not allowed as attachments.
Please attach crash reports, log files and screenshots as they are instead of pasting them into a document.
-- I am a bot. This action was performed automatically! Please report any issues in Discord or Reddit

migrated

I have this bug as well in 1.16.4
The workaround in the post worked for me but i'd love this to be fixed.

migrated

I have this bug in all versions too, (as I have explained in "MC-209403") but the workaround here fixed it for me.

Avoma

Can confirm in 20w51a.

migrated

Followed the instructions for fixing this, however I am still having the same issue with key presses.

My process for cloning and compiling the fixed version of glfw:

Skye@SkyesPC:~
$ git clone https://github.com/LucaRood/glfw.git
Cloning into 'glfw'...
remote: Enumerating objects: 24893, done.
remote: Total 24893 (delta 0), reused 0 (delta 0), pack-reused 24893
Receiving objects: 100% (24893/24893), 11.97 MiB | 7.82 MiB/s, done.
Resolving deltas: 100% (17555/17555), done.
Skye@SkyesPC:~
$ cd glfw
Skye@SkyesPC:~/glfw
$ cmake .
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.9.2 (37dbd4bdf65d21dba0d81940e74801a5504f9c34)") found components:  doxygen 
-- Using X11 for window creation
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/Skye/glfw

I then added this exactly into the launch options:

-Dorg.lwjgl.librarypath="/home/Skye/glfw/"

Would anyone be able to help me out here?

EDIT: I misunderstood the instructions! I followed the instructions by Daniel Wasiak on youtube about this issue and that worked for me.

anthony cicinelli

@unknown please do not ask for help here. This is not a discussion forum. Please go to the subreddit or the discord for discussions.

migrated

Btw. a fixed version of glfw (3.3.3) was released a few days ago, as seen in the changelog 🙂 So the next version of minecraft could include the new version and the problem would be fixed.

migrated

Not bad, 17w47b was only 3 years, 3 1/2 months ago.  Seriously it will be nice though not to have to add the workaround jvm arguments to each new profile.

migrated

Affects 1.17.1

migrated

Please don't keep ignoring this issue

migrated

Could someone please higher the priority of this issue? It is open since 2017, easy to fix and would add a big chunk of joy to play!

migrated

Ditto. This is still a thing in the 1.18 snapshots.

migrated

Still an issue in 1.18 Release Candidate 1. This bug triggers extremely often and is a serious hindrance to playing the game.

migrated

Not trying to be rude but this bug has been around forever and still hasn't been fixed, It makes the game unplayable at times. Its getting kinda ridiculous.

migrated

Yeah the workaround is the only way to deal with it and it will remain that way for modded minecraft since they use particular versions. So I think we're stuck with it since Mojang doesn't care about Linux, enough to fix a basic playable feature.

migrated

This bug is still affecting. It still hasn't been fixed? Got me killed a couple of times.

Fix the bug, please.

migrated

Problem doesn't occur on Arch Linux using i3wm. Might be some distro spesific thing.

migrated

This bug has been around since 2017 and nobody has even been assigned?

migrated

Can confirm. I recently switched to using Linux full time and that apparently means a crappy Minecraft experience. At first I also blamed my keyboard (as it being fairly new) but I have checked with other keyboards and they also have the same issue. I have also tested with my old Windows installation to confirm the problem was not there even on my new keyboard.

Is the Linux user base really so small that this issue is not interesting to get fixed?

As the issue seems to be fixed already in the external library, hopefully we will see this trickle over to Minecraft soon now 🙂

migrated

I set up a keyboard automation that can reproduce this every time on Minecraft 1.18.1.

I did some testing, and found out that 1.12.2 and earlier are completely unaffected, while versions starting from the first 1.13 snapshot, 17w43a, are affected. This was the first snapshot that came with LWJGL 3.1.2.

The workaround by settings XMODIFIERS doesn't seem to fix it for me (although I only tested this on 1.18.1).

migrated

The workaround works for me on 1.18.1! (I'm using Ubuntu MATE 20.04)

XMODIFIERS="@im=null" minecraft-launcher

I was seemingly unable to get the game to pick up a patched (or updated) copy of libglfw, however.

wobst.michael

Can this still be reproduced in 22w16a?

migrated

I have recently switched to a keyboard with a much better polling interval, so it's harder to trigger, but I can't seem to be able to trigger it at all while I still could on 1.18.1. Given the glfw version was bumped, I think it's safe to say that the bug has been fixed.

migrated

I just tested 22w16a and the issue has been fixed.

migrated

Could someone please give me a tutorial so I can actually do this instead of using the vague instructions given to on glfw's github and whatnot..

migrated

This was indeed fixed in 22w16a but it still happens on 1.18.2
Running KDE Neon 5.24 with a 1000hz keyboard

 

EndLordMC

This is still happening for me on version 1.18.2. I'm using Manjaro KDE.
I do not know the detailed specifics of my keyboard, but the model is Havit-KB389L.

Johnibur

@@unknown Nothing is wrong with your keyboard. With the faulty library now updated, this issue is fixed starting in 1.19. 🙂

migrated

(Unassigned)

Community Consensus

Normal

Input

glfw, lwjgl

Minecraft 17w47b, Minecraft 18w01a, Minecraft 18w02a, Minecraft 1.13, Minecraft 1.13.1, ..., 1.16.5, 1.17.1, 1.18 Release Candidate 1, 1.18 Release Candidate 3, 1.18.1

22w16a

Retrieved