[MC-1519] Key gets stuck when toggling fullscreen Created: 31/Oct/12  Updated: 15/Dec/20  Resolved: 25/Oct/17

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.7, Snapshot 13w05b, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18b, Snapshot 13w18c, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w04b, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w40b, Minecraft 1.8.9, Minecraft 16w02a, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12
Fix Version/s: Minecraft 17w43a

Type: Bug
Reporter: Deuphic Assignee: [Mojang] Georgii Gavrichev
Resolution: Fixed Votes: 7
Labels: controls, fullscreen, keyboard, lwjgl
Environment:

OS X 10.8.2. Java: newest(JRE7)


Issue Links:
Duplicate
is duplicated by MC-7185 keybord, press any key bug Resolved
is duplicated by MC-25109 Fullscreen mode looks movement keys Resolved
is duplicated by MC-28952 Freezing mouse (possible to switch ov... Resolved
is duplicated by MC-39201 Mouse buttons stop working after acti... Resolved
is duplicated by MC-40258 Walking while toggling full screen ma... Resolved
is duplicated by MC-45325 Fullscreening while walking causes yo... Resolved
is duplicated by MC-58198 Key releases are not registered while... Resolved
is duplicated by MC-75173 Auto Run When Entering FullScreen Mode Resolved
is duplicated by MC-85293 F11 Glitch Resolved
is duplicated by MC-92031 Sticky keys when switching into/out o... Resolved
is duplicated by MC-105151 it basicly autoclicks on blocks only ... Resolved
is duplicated by MC-119251 Player continusely walks Resolved
is duplicated by MC-119404 Autowalk/Autojump glitch. Resolved
is duplicated by MC-122941 Bug con el F11 Resolved
is duplicated by MC-130133 When tabbed out, auto-clicking bypass... Resolved
Relates
relates to MC-128214 Toggleing fullscreen doesnt make keys... Resolved
relates to MC-886 Sticky movement is back... Resolved
relates to MC-29366 Infinite Jumping Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Creative

 Description   

When pressing down a key (i.e. "W") and pressing F11 to toggle fullscreen at the same time will cause the action that key handles to continue, when the key is released.

I expected the action (moving forward) to stop as I released the key.

What that actually happened was that the action (moving forward) kept on until I pressed another key.

Steps to Reproduce:
1. Press and hold down a key that performs a moving action. Do not release it.
2. Press F11
3. Release F11
4. Release the key you pressed in (1.).
5. Watch. The movement will not stop.
6. Press and release another key on your keyboard.
7. The action stops.

Code analysis

Based on 1.11 decompiled using MCP 9.35 rc1 and https://github.com/LWJGL/lwjgl on 14. December 2016

When fullscreen mode is toggled the following methods are called in this order:

  1. org.lwjgl.opengl.Display.setFullscreen(boolean)
  2. org.lwjgl.opengl.Display.destroyWindow()
  3. org.lwjgl.input.Keyboard.destroy()
  4. org.lwjgl.input.Keyboard.reset()

And org.lwjgl.input.Keyboard.reset() resets the pressed keys. Therefor the keyboard never registers that the keys which were previously pressed are unpressed now.
This can be solved in Minecraft by calling the method net.minecraft.client.settings.KeyBinding.unPressAllKeys() before returning from the method net.minecraft.client.Minecraft.toggleFullscreen().



 Comments   
Comment by Fabian Röling [ 15/Dec/20 ]

I don't know what you mean with "mission control", but that's a different bug. This is about actually holding a key manually and the effect (like opening/closing inventory) happening over and over.

Comment by GameParrot [ 15/Dec/20 ]

This can still be used by entering mission control while holding the key, like w, then letting go while in mission control, and then exiting mission control. This can be used as an exploit to auto mine by holding left click, using f3+t to reload resource packs, and letting go of left click while it is loading. This will make you keep mining, and then you can do the mission control thing to automatically walk, and you will be mining.

Comment by Luke Binkofsky [ 28/Jun/18 ]

argh this was a great bug and there's no alternative way in game can this be added as a feature

Comment by Raymond Xu [ 08/Jul/17 ]

also works when you press F3 instead of F11. If your also holding space, then the player will continue both jumping and walking

Comment by Alugia [ 07/Jul/17 ]

Confirmed for 1.12

Comment by Fabian Röling [ 11/Jun/16 ]

Confirmed for 1.10. I want to note that it's great for afk farming. It can also be done with external tools without exploiting bugs, but it's easier to do when you don't have to use those tools.

Comment by Marcono1234 [ 19/Jan/16 ]

Confirmed for

  • 16w02a
Comment by KingSupernova [ 24/Jan/15 ]

If you just press any button again, the behavior stops.

Comment by Trejkaz [ 24/Jan/15 ]

It certainly affected the gameplay for me, because I wasn't able to use the mouse anymore after it happened.

Comment by KingSupernova [ 23/Jan/15 ]

Confirmed in 1.8.2 pre-4. To be honest, I find this very useful, and as it doesn't actually affect the gameplay, I would prefer if it were not fixed.

Comment by Galaxy_2Alex [ 24/Oct/14 ]

Reproduced in 1.8.1 Pre3 on Windows 8.1.

Comment by Trejkaz [ 27/Jul/14 ]

I can't speak for this ticket itself, but the issue I reported which was marked as a duplicate (MC-39201) appears to have been fixed some time before 14w30c. The current behaviour is that letting go of the mouse button while Mission Control is up immediately stops the mouse action, so no buttons are down on re-entering Minecraft.

Comment by [Mod] Ezekiel (ezfe) [ 26/Jul/14 ]

Is this still a concern in the latest Minecraft version 14w30c? 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 Trejkaz [ 09/Nov/13 ]

I guess this bug's scope just got wider. It also affects mouse buttons and also occurs when doing actions other than fullscreen.

And still occurring with the combination of OS X 10.9, Java 7u45, Minecraft 1.7.2.

Rafael might be right about it being LWJGL. It could also be Java itself, because there is a similar quirk in AWT/Swing where if you press the mouse on a window and release it outside the window, the application gets a mousePressed but no mouseReleased event. Applications (and frameworks) have been working around it by listening for other events. That issue itself supposed got fixed in Java 8 but I'm not sure if it got back-ported to 7.

Comment by Rafael Ristovski [ 25/Apr/13 ]

This might be a LWJGL issue and not a Minecraft one, try updating to the newest version of LWJGL and try again perhaps.

Comment by Meta [ 31/Oct/12 ]

Confirmed

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