[MC-3643] CTRL / CMD key get stuck on OS X / Text Box Backspace deletes whole word or whole line on Mac and Linux Created: 21/Nov/12  Updated: 17/Jun/21  Resolved: 25/Oct/17

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.5, Minecraft 1.4.7, Minecraft 1.7.4, Minecraft 14w07a, Minecraft 1.7.10, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34c, Minecraft 1.8, Minecraft 1.8.1-pre2, Minecraft 1.8.1, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.5, Minecraft 1.8.7, Minecraft 1.8.8, Minecraft 15w34a, Minecraft 15w41b, Minecraft 15w44b, Minecraft 15w45a, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.4, Minecraft 16w21b, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w35a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.2
Fix Version/s: Minecraft 17w43a

Type: Bug
Reporter: Zack Hixon Assignee: Unassigned
Resolution: Fixed Votes: 46
Labels: backspace, chat, cmd, command-key, hilight, input, keyboard, lwjgl, selection, sticky-keys, typing

Issue Links:
Duplicate
is duplicated by MC-11369 When typing, if you spell a word wron... Resolved
is duplicated by MC-13436 "Q" and "backspace" button Resolved
is duplicated by MC-14103 Delete button, deletes whole sentence... Resolved
is duplicated by MC-16666 Chat Box / Commands - When Trying to ... Resolved
is duplicated by MC-22427 Keys get "stuck" Resolved
is duplicated by MC-24547 Mac OS X command key gets stuck Resolved
is duplicated by MC-25312 Typing in Multiplayer Sometimes Delet... Resolved
is duplicated by MC-25967 Backspace in chat on OS X deletes ent... Resolved
is duplicated by MC-26780 Backspace on OS X is broken on chat Resolved
is duplicated by MC-26982 MAC OSX Hotkeys do not function properly Resolved
is duplicated by MC-28093 MC 1.6.2 Mac spaces Resolved
is duplicated by MC-28214 Backspace erases entire word Resolved
is duplicated by MC-29381 Mac Chat Issues Resolved
is duplicated by MC-30550 When i chat it deletes the whole word... Resolved
is duplicated by MC-31645 Chat deletes entire word, instead of ... Resolved
is duplicated by MC-36479 Mac / Keyboard Issues. Control/Comman... Resolved
is duplicated by MC-40396 Backspace deletes entire word Resolved
is duplicated by MC-41768 In chat, backspace deletes by word in... Resolved
is duplicated by MC-47486 Backspacing on mac Resolved
is duplicated by MC-48451 Backspace deletes whole word in chat Resolved
is duplicated by MC-70528 Chat stops working corrctly when swit... Resolved
is duplicated by MC-70642 Sometimes Cannot Type Letter "A" Resolved
is duplicated by MC-72391 Highlights words when i press a in an... Resolved
is duplicated by MC-73467 cmd key gets stuck when trying to typ... Resolved
is duplicated by MC-74305 Chat / Inventory Search losing charac... Resolved
is duplicated by MC-74865 Text entry boxes act strange when oth... Resolved
is duplicated by MC-77637 Command Line Keys Automatucally Act a... Resolved
is duplicated by MC-78088 Letters on Keyboard nor working Resolved
is duplicated by MC-78766 Command key mistakenly read as held d... Resolved
is duplicated by MC-79999 Minecraft seemingly randomly stops al... Resolved
is duplicated by MC-80310 Command Key Sticks in Mac after Comma... Resolved
is duplicated by MC-81730 Minecraft Chat Bug Resolved
is duplicated by MC-86693 "A" and "X" Key do not work in chat Resolved
is duplicated by MC-86694 Delete Key does not work in chat Resolved
is duplicated by MC-88909 OS X - No Keybind option for Auto mov... Resolved
is duplicated by MC-89612 Pressing "Q" drops entire stack on oc... Resolved
is duplicated by MC-104498 Keyboard layout issue Resolved
is duplicated by MC-105432 whenever i try to play minecraft, the... Resolved
is duplicated by MC-119001 Copy and Paste... Resolved
is duplicated by MC-121051 Text input broken after switching foc... Resolved
is duplicated by MC-123956 Typing commands gets halted or truncated Resolved
is duplicated by MC-130402 Narrator Activates When Typing "B" in... Resolved
is duplicated by MC-4331 Chat error, stuck key. Only on Mac OS X Resolved
Relates
relates to MC-23132 Click or right-click stuck on OS X Resolved
relates to MC-88908 OS X - When CMD+A in the Commandblock... Resolved
relates to MC-90021 Cmd key doesn't seem to work all the ... Resolved
relates to MC-113915 Inadvertently saving/overwriting save... Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Creative

 Description   

When I open my inventory and go to the search tab, I enter something in and everything goes wonky. I am done searching so I press backspace and the entire search term disappears. I enter the chat to say hi to my friend who just joined, I misspelled his name and I tried deleting the accidental character, and the entire name disappears. Say his name was George, and I type Goerge instead. I would press backspace, and all "Goerge" would disappear. (Get what I mean?) This happens until I completely re-start the game.


Delete whole word: CTRL is stuck, delete whole line: SHIFT is stuck.

Steps to reproduce on OS X:

  1. have Minecraft and at least one other app open in fullscreen mode
  2. open chat, type a few letters
  3. holding ⌘, switch the other fullscreen app by swiping left/right with 4 fingers on the trackpad (⌘⇥ also works if you press ⌘ quickly enough while the app switch animation is active)
  4. release ⌘
  5. switch back to Minecraft
  6. press A. This will select the text you typed instead of writing the letter A.


 Comments   
Comment by Alan Klas [ 17/Jun/21 ]

This is happening for me in 1.16.5 on windows, hitting the alt or windows key fixes it temporairly i don't remember which one

Comment by [Mod] Pokechu22 [ 08/Apr/18 ]

17w43a is a 1.13 development snapshot; this issue is fixed in prerelease builds but not current releases.

Comment by Flaming Dorito [ 08/Apr/18 ]

Currently on the latest Minecraft 1.12.2, a clean install with no modifications.
MacOSX.
I can confirm this problem still occurs. I'm still able to reproduce the issue. It has not been resolved.

Comment by Fenhl (Max Dominik Weber) [ 25/Oct/17 ]

Same here. This appears to be fixed in 17w43a.

Comment by ziggurism [ 25/Oct/17 ]

I'm not seeing this behavior in 17W43A, the new snapshot which updated to LWJGL 3. May be fixed?

Comment by Timothy Miller [ 15/Jun/17 ]

TL;DR: Fixing stuck-on Command might also "fix" stuck-on right-click, which a lot of people rely upon heavily. Best not to create that much havoc over something fixed by remembering to tap Command an extra time.

Long version:

I would like to give a warning to those who are asking too vehemently for this bug to be fixed. This bug is annoying. No question there. But fixing it may have undesirable consequences for many.

For me, this meta key problem never became a huge nuisance until Command was chosen as the meta key for saving hotbars in creative mode. Every time I would switch from/to Minecraft, pressing a number key would wreck one of my saved toolbars. I had suggested using Option instead, but Mojang's choice of using C and X was all-around a much better solution. Now, the only times this is a problem is in chat and when I press Q, making throwing items vs. stacks inconsistent. And it's dealt with by trying to remember to just tap Command an extra time when returning to Minecraft.

This bug is caused by a bug in some library that Minecraft uses to process key input. I've written my own Java code to test this, and I find that if you Command-Tab away, the command key down event is delivered, but there's no key up even. Then when you command-tab back, the key up for Command event is delivered. For some reason that key up event is lost by this library, and I suspect it has something to do with a change of focus happening at the same time. I've spoken directly to Dinnerbone about this on IRC, and if I recall correctly, he said something about not having access to the source code to this library. So they'd have to rewrite it from scratch to fix the problem.

But let's say they fixed this problem. In fact, there are other keys that also get stuck on when there's a chance in focus. An important one is right-click. You can intentionally get right-click stuck on by holding it down and then pressing F11. People rely on this for things like AFK fishing farms and AFK sand sweepers for removing the water from around ocean monuments.

If Mojang were to go through the effort to fix this bug, then there's a distinct possibility that the F11/right-click trick would get "fixed" as well. A lot of people (including possibly some devs at Mojang) are somewhat antagonistic to AFK fishing, because they consider it overpowered. I'm sure there's an app you can install that will spoof keys to applications of your choice, but do you really want to go to that trouble?

Now, I personally would be happy to volunteer to rewrite this module from scratch. All I need to know is the API, and I could probably write a drop-in replacement. It depends on how much platform-specific issues I'd have to deal with, which could balloon the development time. I would release it under an MIT or Apache license or whatever people want. One of the problems here is that Mojang seems to have some massive fear of accepting code from outsiders, even bug fixes and from people begging them to take the code with no strings attached. I really don't understand what makes them tick.

Comment by Lennard Berger [ 05/Jun/17 ]

Giving a little more input: This must be related to LWJGL. It happened to me that there would be text in the chat box (when I switch tab out & in) which has been previously in memory (by another program) in an unused chunk of the memory (apparently the software did not dereference the string properly). Good news is: By using the command slash (one or multiple times) the bug usually disappears after a short amount of time.

Comment by John [ 15/May/17 ]

Ah yes. The narrator turning itself on whenever I want to tab back into the game.

Comment by Nathan Wolf [ 15/May/17 ]

Fun new 1.12 side-feature: there must be some kind of key combination for the narrator, because it's constantly turning on for me as a result of this bug.

It really would be nice if this could get fixed.

Comment by Christoffer Larsson [ 14/May/17 ]

Glad this was reopened. So annoying and makes the Minecraft chat almost unusable.

Comment by John [ 09/May/17 ]

Whatever it is, it's extremely irritating.

Comment by jonathan2520 [ 14/Mar/17 ]

LWJGL has been implicated before. I think there's a mention out somewhere else that LWJGL 3 would fix it.

It certainly has nothing to do with the kernel. The kernels aren't even the same. What GNU/Linux and macOS share is a similar command line and POSIX-ish mid-level programming environment. Both higher and lower levels are fundamentally different. The relevant difference is in the UI APIs and how they're (ab)used by Minecraft and its libraries.

Comment by Donovan [ 14/Mar/17 ]

Can confirm on `OS X 10.11.6 (15G1212)` MC 1.11.2 (Modded, Major Mods: MCForge, Optifine). Also is still reproducible after switching modifier keys, this can be accomplished by going to `System Preferences -> Keyboard -> Modifier Keys` and swapping the `Command Key` with another modifier key.

==EDIT==
After looking at Minecraft's source code (through the minecraft forge sdk) I have determined this: This is most likely a problem with LWJGL 2 or OSX, I do not know if updating to LWJGL 3 will fix this problem. The way that minecraft handles stuff like `Ctrl/Cmd + a` is as follows: Minecraft queries LWJGL to determine if the 'a' key is pressed, then it ensures that the 'Shift' and 'Alt' keys are not pressed, then it checks if the 'Ctrl/Cmd` key is pressed this is done by checking the keycodes `219` (L_META/L_CMD) and `220` (R_META/R_CMD) if minecraft is running on OSX, on Windows it checks for keycodes `29` (L_CTRL) and `157` (R_CTRL). Minecraft does all of these checks by using the method `org.lwjgl.input.Keyboard#isKeyDown(int)`. LWJGL 3 uses GLFW for keyboard input and I have not found any issues reporting the same problem on there github issue tracker. This possibly could be fixed by updating to LWJGL 3 or it could be an internal problem with OSX, this is not a problem with Java since all keyboard handling in both LWJGL 2 and GLFW is done natively (with C/C++ code).

==EDIT 2==
People have mentioned reproducibility on Linux so this is most likely a problem with LWJGL2. Possibly the Unix Kernel but OSX has modified the Kernel enough that it is probably not the case.

Comment by jonathan2520 [ 07/Mar/17 ]

This is so much worse now that command+digit saves hotbars in 17w06a. It was reported separately as MC-113915. It is really a duplicate of this one, but it alone is bigger than this used to be. Please expedite fixing.

Comment by S B [ 28/Feb/17 ]

Confirmed in 1.11.2.

Comment by user-f2760 (Inactive) [ 05/Dec/16 ]

theosib2 summary of this ticket:

...on Mac and Linux

Comment by Timothy Miller [ 05/Dec/16 ]

I can confirm this too, with the same setup as Simon Wermuth. Is this perhaps a macOS bug?

Comment by Simon Wermuth [ 21/Nov/16 ]

Confirmed for macOS Sierra 10.12.1
Running Java 1.8, with Minecraft 1.11 vanilla.

Comment by Oliver Brammer [ 07/Aug/16 ]

Confirmed for Mac OS X El Capitan, running Java 1.8 with Minecraft 1.10.2 (vanilla, no mods).

This has been an issue for far too long, and is incredibly frustrating. Whilst I've never personally encountered it on Linux, it was always a problem on OS X. I've also tried under macOS Sierra running Java 1.8, with the same result.

Comment by Jeffrey M James [ 10/Jun/16 ]

Still exists in 1.10

Comment by John [ 30/May/16 ]

Still exists in 16w21b.

Comment by Nathan Wolf [ 08/Apr/16 ]

It'd be nice to get some feedback either way. I don't see this behavior from other Java apps, so I can't imagine how low-level it could be.

If Mojang uses Macs I am a little shocked this doesn't drive them crazy- I know I'd want to nail it down if it were me. So you could be right, that there's some reason it's very hard to fix, that would be both surprising and a little disappointing.

Any possibility for a response from the team? The provided work-around really doesn't help anything, as you can see the numerous examples of how annoying this is. Yes it's "fixable" but not until after you're already frustrated about it. I'd love to say after years of dealing with it I've trained myself to mash command every time I alt-command back to MC, but apparently it's just not sticking in my brain.

Comment by ziggurism [ 08/Apr/16 ]

I don't know if it's useful to speculate on the bugtracker like this, but it's my impression that low-level stuff like modifier keybinding is handled not by minecraft, but by something lower in the stack. Like when we had a bug to improve Chinese keyboard input methods in Minecraft chat (MC-2781), it turned out not to work with Macs (MC-91132), but according to comments there, this was something that had to be fixed by the LWJGL team. This issue could be similar. I know some of the Mojang team do use macs, so the assertion that they would fix it immediately is demonstrably false. It's possible that the fix is not that straightforward.

Comment by jonthesquirrel [ 08/Apr/16 ]

Something to note is that when the command key is stuck, not only does backspace clear entire words, but "a" selects-all, "v" pastes, and "x" cuts whatever is selected. (until pressing the command key a few times)

Comment by Zedadias Wick [ 08/Apr/16 ]

Agreed. It's infuriating having to retype messages all day, especially commands when working with command blocks.

It's not listed, so confirming this still exists in 1.9 and 1.9.2.

Comment by Andrew Gordon [ 08/Apr/16 ]

Can we PLEASE get an update on this? This bug has existed for a very long time and it's incredibly frustrating. It has resulted in hours of retyping messages. I agree that if any Mojang devs attempted to use the Mac version of this game (and used Command Tab app switching) they would fix this bug immediately.

Can we please get some attention to this!

Comment by [Mod] Ezekiel (ezfe) [ 10/Nov/15 ]

Just so people know, if this is occurring for you, press the command key a few times and it'll fix temporarily. It's super annoying for me too.

Comment by Nathan Wolf [ 09/Nov/15 ]

Just checking in to say that this bug makes me scream at my computer at least once or twice a day.

I'm guessing the Mac client is not exactly super high-priority now, if it ever was.

I think if any one of the Mojang devs tries to use the game on Mac for just one day, this bug would get fixed. It's truly infuriating for anyone doing MC dev of any kind, since that routinely requires alt-tabbing away, and then back to type a command. 99% of the time you end up having to re-type the whole command, after realizing you just spewed some gibberish into chat. It's maddening!

Comment by jonthesquirrel [ 14/Oct/15 ]

This happens to me too when switching desktops to my minecraft window in fullscreen, the command key gets stuck until I tap it inside minecraft. (Mac OS X 10.10, Java 8), still an issue in 15w41b.

Comment by John [ 29/Sep/15 ]

1.8.8 presents this issue as well. When I type the "a" key, it highlights my sentence, and any further key stroke causes the sentence to be deleted. This also happens when I try to drop items using "Q". Instead of dropping one item, the whole stack is dropped.

Comment by Federico Isacchi [ 12/Sep/15 ]

I encounter often this bug. It's very annoying.

@Christopher:
That workaround doesn't work for me (Mac OS X 10.10, java 8, MC 1.8.8)

Comment by Adriaan Renting [ 23/May/15 ]

This just happened to me on Minecraft 1.8.5
OSX 10.9.5 Mavericks. 8 GB, 6750M video, i7
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
I was logged into a server also running MC 1.8.5 on Ubuntu 12, although I think it's got nothing to do with it.

It does seem to be related to Command-Tab and/or switching between Minecraft and other applications.

Comment by Christopher OBrien [ 16/Feb/15 ]

Easier reproducer on OSX: Command-Tab to switch to a different window. When you switch back to the Minecraft window any keystrokes behave as if the Command key were still depressed (thus V behaves like Command-V, backspace like Command-backspace, etc).

Workaround on OSX: If you tap Command once or twice the problem corrects and keystrokes behave normally.

Perhaps check for the state of modifiers when the Minecraft window regains focus? Normally I'd be happy to submit a patch but...

Comment by HennoeR [ 22/Oct/14 ]

for me this also seems to appear if the cmd key gets stuck and I try to write the letter V the content of the clipboard gets copied into the text box

Comment by qmagnet [ 20/Aug/14 ]

I cannot reproduce with Windows. Please update title to clarify this for others testing.

Comment by [Mod] CubeTheThird [ 20/Aug/14 ]

I am able to reproduce this with Ubuntu. Others have confirmed it previously with OSX.

Comment by qmagnet [ 20/Aug/14 ]

This is reproducible as a bug? Is this not a hardware related issue with the keyboard itself? I cannot replicate this.
Or if this bug is specific to Ubuntu (whatever that is), maybe the title should clarify that?

Comment by qmagnet [ 19/Aug/14 ]

Cannot reproduce this issue in 14w34b

Comment by Galaxy_2Alex [ 21/Jan/14 ]

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.8 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by [Mod] CubeTheThird [ 11/Dec/13 ]

I can confirm, following Tavis' steps. That being said, I'm not sure this could be fixed, as the game would have to be constantly checking if the shift and ctrl keys have been released.

Comment by CosmicVoyager [ 18/Nov/13 ]

Pressing backspace deletes an entire word of text instead of just one letter. I noticed that if I press the command key it switches to deleting one letter.

The is a major constant annoyance.

Minecraft 1.7.2
Mac OS X 10.6.8
Java 6

Comment by Nathanael Green [ 19/Sep/13 ]

I have this issue on Mac OSX, with both 1.6 and the new snapshots.
Occasionally the chat returns to normal, if I repeatedly tab out of the game and back in. (as that seems to cause it for me)

Comment by fullname1 [ 23/Jul/13 ]

So.... is there a solution for this or not....

Comment by Anon Ymus [ 15/Jul/13 ]

Reopened.

Comment by Tavis [ 04/Jul/13 ]

This is not a duplicate of MC-886. Opening GUIs (including chat) clears the state of most keys, but does not clear the state of the control key.
To reproduce the problem:

  1. Open a GUI to free your mouse
  2. Hold CTRL
  3. Click on another window to make Minecraft lose focus
  4. Release control
  5. Go back to Minecraft and open chat
  6. Type a multi-letter word
  7. Press backspace
  8. Observe that the whole word has been deleted

For completeness, I am using Ubuntu.

Comment by Tails [ 11/Apr/13 ]

Resolving as duplicate of MC-886 (see also MC-205).

Comment by Tails [ 28/Mar/13 ]

Ctrl+backspace deletes whole words, maybe caused by MC-886?

Comment by Tails [ 05/Feb/13 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Zack Hixon [ 22/Nov/12 ]

@Xavier Brown Thanks, please do.

Comment by FireHunterX [ 21/Nov/12 ]

I can confirm this. It also sometimes does this with Signs and Book and Quills.

Generated at Sun Jan 12 12:01:54 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.