mojira.dev
MC-122477

Linux/GNU: Opening chat sometimes writes 't'

The bug

Sometimes when opening chat it writes 't' (Different character if bound to another key). It doesn't appear to happen on Windows.

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

MC-122833 Repeat key when going into chat MC-124135 Double t and / detecting when opening chat buffer. MC-126157 When opening chat the hotkey gets added as the first character every time. MC-126763 Pressing Chat key sometimes adds the corresponding letter in chat MC-127937 Opening chat will make me type t MC-130394 Whenever chat is opened a t is typed into it automatically MC-131070 Key "Doubling" when opening text box input GUIs MC-134552 The same character is input twice when I input "/" or "t" MC-135905 I changed my command key but it doesnt always work. MC-136780 Opening chat window inserts bound key into chat occasionally MC-139406 Forward slash "/" key opens chat message with two slashes in front ("//”) MC-139944 When I press / to do a command, there are two slashes instead of one. MC-141504 Linux input issues MC-145481 Opening chat puts chat hotkey character into textbox MC-190876 Chat key and command key sometimes repeat twice on Linux MC-207018 Pressing t to chat adds another t in chat on linux MC-214389 Button buffering in chat MC-225420 Repeated Key Presses for Linux Users

Comments

Eyyy

Unrelated to Minecraft itself, it's either your computer, your mouse, or your touchpad. Everyone experiences this, some more than others, and there's nothing that Mojang can do to fix it. : /

chokoboy3

Actually this is unrelated to my hardware. It did not occur in 1.12.2, so it came with 1.13 or perhaps because of LWJGL 3.

Jeremy Beane

This also happens to me too. I get duplicate key registers for the open chat key and open command key. Changing the open command key to the keypad 1 key results in "/1". This issue only ever happens when opening the chat buffer and not while its open. I've only had this issue with 1.13 snapshots and no other version of minecraft or any other program for that matter.

Domenico Rotolo

The bug seems to occur only on Linux operative systems. Had the same problem with another game too though!
This bug still persists in the latest snapshot

Gary L

Can also confirm on Ubuntu 16.04 LTS on 1.13 release, however this bug does not appear on Windows on the same computer. If i downgrade to 1.12.2 then this issue does not occur.

polu

Confirmed for 1.13 on Debian 9.5 with OpenRC

OS OS

I can confirm this on 1.13.1 using Ubuntu 18.04.1

 

William Palmer

The same occurs when opening chat via the / key, which is annoying because when pressing /, Minecraft automatically inserts / at the beginning, so it inserts two / characters.

I use the gnome window manager

ProIcoP

I can confirm this on 1.13.2 using Fedora 29

Octupus Tea

Can confirm this on both 1.13.2 and 1.14.
I am using Linux Mint 19.1 (MATE) with Oracle Sun Java 1.8.0_201.

bilguun0203

I think this is related to your system (hardware or software). I had this issue before but fixed after some updates and don't know what exactly causes this issue.

I'm using Archlinux, GNOME/i3wm, OpenJDK 1.8.0_212.

BakiDance

Can confirm for Ubuntu 18.10.This issue is not present in older versions.

 

Binding the input key for chat/command to one that does not typically insert a text character is a work-around. (For example, setting "open chat/command" as Enter negates the duplicate t or /).

MetoolDaddy

That's not a real workaround. The real cause of this problem is input lag, so typing would still be hard at low FPS.

Dawid

Can confirm for Ubuntu 18.04.2 LTS x86_64 with Minecraft 1.14.4 using 5.1.0-050100-lowlatency kernel. Annoying as hell. Still, not fixed.

Gabrijel

This is still happening in 1.15 pre-release 1.

Jonathan Frank Tippy

did anyone find a way to fix this? it's driving me insane

imDaniX

Still, relevant for Ubuntu 19.10 with Minecraft 1.15.2 on OpenJDK 11. For me the problem appears only with Gnome desktop environment(tested with Cinnamon), mostly when FPS drop to <30.

Gabrijel

Affects 20w08a.

Rockethub

This problem still persists, as well as it putting a t in chat quite often when I type. Bumping this in the hope it gets fixed soon. - Running 1.15.2 btw.

RecursiveG

For anyone who wants to workaround this without rebinding keys, I wrote a mod for 1.15.2 trying to fix this. https://github.com/RecursiveG/Mc122477Fix

Ryan Matthew

Happens with / for comments too (am using Ubuntu 20.04, has happened in all versions I've played)

Marty McFly

Cannot reproduce on Arch Linux. Maybe input driver related? I'm using libinput.

grep -e "Using input driver " Xorg.0.log
Terminator_NL

Reproduced on Fedora 31 and Gnome version 3.34.6.

An_yMiner

@unknown I'm on arch with libinput, but it happens for me too.
Reproduced on Arch Linux(linux: 5.7.2.arch1) with Gnome 3.36.3.1 on X11(xorg 1.20.8) and openjdk version 1.8.0_252

Ethan

Reproduced in vanilla 1.16.1 running on Ubuntu 20.04, GNOME 3.36.2, Java 11.0.7 64-bit.

Ryan Matthew

This also occurs when opening creative inventory on search tab, typing the character "e" (or whatever it's binded to). My temporary solution is just binding chat/command to page down and page up buttons so nothing is typed.

ZaenonWP

I have this same issue as well (I use Ubuntu 20.04 with KDE Plasma 5, 4GB RAM), but I also experience an issue that might have the same underlying cause.

The issue I am talking about is that my game input gets "lagged" in a way, and as soon as I open any text input (such as chat or world seed), the lagged input gets applied there.

Of course, that issue might be a separate issue entirely, but I felt as if it was worth mentioning here.

BlueManedHawk

I cannot reproduce this on GalliumOS 3.1

BakiDance

This seems to only occur on GNOME DE (after versions 3.36.x?). Still, this bug does not occur on versions before 1.12.

Earthcomputer

Could this be https://github.com/glfw/glfw/issues/747 ?
In that case, this bug would be fixed by updating the version of glfw that Minecraft uses to 3.3.

By the way, if this is the issue, then to have the best chance of reproducing it, you want to use the X11 window manager, and make sure the game is running at a low framerate (client-side lag).

null

I'm not quite sure. I find that this issue sometimes occurs even when I am at a constant 60 fps with no lag spikes. Limiting my framerate to 10 fps doesn't make the issue more common.

I can reproduce on GNOME on Pop!_OS 20.04.

I cannot reproduce on KDE on Arch Linux.

Both are using xinput and X11.

BakiDance

Since I've first responded to this ticket I have rebuilt my PC and installed a different distro. I'm now using Pop!_OS 20.04 (GNOME), rather than Ubuntu 18.04, and this bug is still present. I've used KDE on this same machine and this bug does not happen on that desktop environment. At no point is FPS a factor in when this happens. My game has never been lagging when this happens; and it nearly always happens when opening the chat or entering a command.

This seems to be directly related to GNOME (perhaps on Ubuntu-like systems?), and happens regardless of system load or game lag.

null
Nicefisher

Can confirm for 1.16.4 on Ubuntu 20.10

Blanket Duck

Not sure this is a bug. It sure happens though, I'm using macOS and I have my chat key as / and whenever I press it I have to delete the /

William Duncan

@Blanket Duck that is unrelated. When pressing `/`, this bug will add a second slash. When pressing `T`, which is the default key to open chat, 0 to 2 `t`s will be already in the input.

It does happen almost 100% of the time when the FPS is low, but limiting your FPS to 10 will not reproduce the bug. Limiting your framerate does not simulate overload on your PC.

I can reproduce the problem on Ubuntu 20.04.01 LTS x86_64 (DE: Gnome 3.36.8, WM: Mutter, Windowing system X11) with Minecraft 1.16.4.

The same problem has been reported as well here: https://gaming.stackexchange.com/questions/341086
The suggested solution (to change speed/delay of repeating keys in Settings > Universal Access) did not resolve this issue for me even with the slowest settings. I cannot reproduce this issue on older versions such as Minecraft 1.12.2.

I suspect this has to do with the updates keypresses are handled. Holding down `t` while in-game will open the chat and enter several `t`s inside. Holding E will toggle quickly the inventory, etc. Is it possible that repeating keys are handled by the game, since the OS settings have no effect on the issue?

Conner

@Eyyy This only happens on versions 1.13 and above. Lower versions dont reproduce this bug leading me to believe it is something to do with minecraft/is something that Mojang can fix.

WitherSlayer5000

You double pressing the chat open button?? that would register to computer as open chat for first "t" and type "t" in for second pressed "t"  

null

Code analysis based on 1.16.5 with yarn mappings.

GLFW distinguishes between two kinds of inputs: key inputs and character inputs. Key inputs are for controls (e.g. WASD), while character inputs are for typing text (e.g., in chat).

Importantly, key inputs are not processed immediately; they are polled and then processed on the next game tick. Character inputs, on the other hand, are processed immediately when they are received.

When a button on the keyboard is pressed, like "t", a key event and then a char event are received. The key event is processed first, but remember that it doesn't do anything until the next game tick. Then, the char event is processed, but this doesn't do anything, because the chat hasn't opened yet. So, as long as there isn't a game tick between the key and char events, there won't be a phantom key press.

The game polls input events using glfwPollEvents(). This processes all incoming events at once, so the key and char events should both fire during one call to glfwPollEvents(), so a game tick cannot happen in between. However, on some Linux machines, the char event is actually received on the next poll (https://github.com/glfw/glfw/issues/1794). This means that there could be a game tick in between, meaning the chat will open and then receive the char event and type "t".

The reason this only happens sometimes is simply because the game polls events twice per frame. Specificially, com.mojang.blaze3d.systems.RenderSystem.flipFrame(long) calls glfwPollEvents() twice. Therefore, two consecutive polls could sometimes have a game tick in between and sometimes not.

Marcus H

There is a Fabric mod available that fixes this https://github.com/RecursiveG/Mc122477Fix

0x5e3371ebe11e

This also affects the search item tab in the creative inventory screen, randomly writing an 'e' into the search bar when opening it.

Dudhhr

Can confirm on 21w14a

Edwin Löffler

I can confirm this still happens in 1.17

Marcus H

This bug is present in 1.17.1 as well.

Napero

I can confirm this bug for 21w39a.

Please, this should be fixed asap, it makes the chat unusable without this mod: https://github.com/RecursiveG/Mc122477Fix

AnInflammableRoo

I can't confirm this, but the bug may be specific to GNOME.

Jaco Malan

This doesn't happen on my PC (ArchLinux) which has KDE Plasma installed, but it does happen on my laptop which runs Ubuntu 21.04 with GNOME 3

elwyn

Can confirm bug is still present in 1.18.1, running in Debian 11

null

For whatever reason, this issue doesn't seem to occur when playing vanilla 1.18.1 on MultiMC. However, it does occur when playing vanilla 1.18.1 on the official launcher.

Maybe it's because MultiMC uses different versions of some libraries? In that case, perhaps bumping the version of some library would fix this bug.

MrMan314

I am on Ubuntu 20.04 using Gnome Desktop Environment. On Lunar Client and normal Minecraft in 1.18, not only does opening chat send t, but pressing '/' sends another '/', making the content "//". Additionally, if I was moving before, it would spam whatever keys I was typing, and it would non stop type something like"wwwwwwwWWWWAAAAssssssssss" and it would not let me delete it or type anything else until it reaches the end of the input. It's driving me absolutely nuts!!!

I initially thought it was something wrong with my drivers, because I installed Ubuntu on my MacBook Air because it was too slow.

Florian Cassayre

I can confirm this bug. I am running Ubuntu 20.04.2 (Gnome as well) and randomly about half of the time I press "t" to open chat, not only does it open the chat context but also types a "t" in it. There doesn't appear to be any other problems, in particular I am not getting duplicate letters when I type stuff. I am using the latest Minecraft version, namely 1.18.1 (unmodded, official launcher).

Edit: confirmed for Ubuntu 21.10 as well.

Edit²: confirmed for Ubuntu 22.04.

SPGoding

I can confirm what @unknown mentioned earlier: using MultiMC as the launcher doesn't seem to have this issue.

EchoBlade

Can confirm pressing the slash key sometimes writes two slashes to the chat. Using Garuda Linux, an Arch-based distro.

Snowgnome

it als ohppens with both t and / on ubuntu 20.04

totemo

Also on Fedora 36 Linux. And this (extra 't' and '//') has been troubling me for many years and many versions of Fedora. Is it really that hard to fix or do you just not care?

Thierry Ouellet

ZorinOS 16.2 (Ubuntu 20.04), I also have this issue and it's VERY annoying.... Please fix!

HitCoder

EndeavourOS on Linux 5.15 kernel. Still have this issue. I find it a little upsetting that official devs have resorted to recommending that we just use a different launcher :/ but i guess project managers will only assign bugs to devs that help the company earn money.


Reply from @unknown:

No developers have recommended to just use a different launcher. Users with [Mod] in their name are just regular players. We mentioned MultiMC in the comments to hopefully help the developers locate the cause of the issue. As the ticket is still open it's highly likely the developers will work on it – we just don't know when 😛.


My apologies! I misinterpreted that. And yeah, no I have nothing against devs but I do feel like the companies behind big products and games will not let their devs work on issues unless they feel they'll have monetary gain from it, so i do worry about that a bit.

RecursiveG

For people who don't want to use a mod nor a particular launcher, they can build a patched libglfw.so: build_patched_glfw.sh

xXFoxGamesXx

Confirmed on Ubuntu 22.0.4 on MC Version 1.19.4

Chain Sword

still annoying me constantly. @mojang/microsoft would you please fix this?

JoshCaladia

ohhh i thought i was just pressing the key twice lol. same applies with the command hotkey, "/"

Leon Baur

I always thought everyone has this bug. This should be fixed.

chokoboy3

(Unassigned)

Confirmed

Platform

Normal

Input

Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a, ..., 1.19.4, 1.20.4, 23w51b, 1.20.5 Release Candidate 2, 1.21

Retrieved