[MC-5520] Crash when toggling fullscreen mode: Keyboard must be created before you can read events Created: 29/Dec/12  Updated: 07/Apr/18  Resolved: 25/Oct/17

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w09a, Snapshot 13w09b, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w21b, Snapshot 13w22a, Snapshot 13w24a, Snapshot 13w24b, Snapshot 13w25a, Snapshot 13w25b, Snapshot 13w25c, Minecraft 1.6, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w36a, Minecraft 13w36b, Minecraft 13w39b, Minecraft 13w41b, Minecraft 13w42b, Minecraft 1.7.2, Minecraft 13w48b, Minecraft 1.7.4, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 1.8.7, Minecraft 1.8.8, Minecraft 15w34a, Minecraft 1.8.9, Minecraft 15w50a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.10.2, Minecraft 1.11.2, Minecraft 1.12
Fix Version/s: Minecraft 13w36a, Minecraft 17w43a

Type: Bug
Reporter: James Clarke Assignee: [Mojang] Georgii Gavrichev
Resolution: Fixed Votes: 14
Labels: client, crash, fullscreen, fullscreen-mode, lwjgl, monitor
Environment:

Operating System: Mac OS X (x86_64) version 10.8.2
Java Version: 1.6.0_37, Apple Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.


Attachments: Text File DxDiag.txt     Text File Minecraft crash.txt     Text File crash-2012-12-29_14.05.16-client.txt     Text File crash-2013-06-06_22.57.55-client.txt     Text File crash-2017-06-06_19.43.12-client.txt     Text File crash-2017-06-06_19.46.31-client.txt     Text File crash-2017-12-04_15.28.59-client.txt     Text File crash-2017-12-04_15.45.57-client.txt     PNG File crash.png    
Issue Links:
Duplicate
is duplicated by MC-10566 Crashing when going into Fullscreen Resolved
is duplicated by MC-13306 Crash when changing to fullscreen Resolved
is duplicated by MC-17056 Full Screen Crash Resolved
is duplicated by MC-17357 Crash when switching to fullscreen wh... Resolved
is duplicated by MC-17737 Fullscreen Crash Resolved
is duplicated by MC-18345 crash game Resolved
is duplicated by MC-18417 When F11 is pressed (to go to full sc... Resolved
is duplicated by MC-20204 Impossible to play in full screen Resolved
is duplicated by MC-20558 F11 caused a crashed Resolved
is duplicated by MC-21665 Dual monitor crash On mac (Only resiz... Resolved
is duplicated by MC-22475 crashed Resolved
is duplicated by MC-23103 Crash Resolved
is duplicated by MC-24527 Switch to fullscreen crash Resolved
is duplicated by MC-25733 Pressing full screen in options crash... Resolved
is duplicated by MC-27660 Full Screen Crash Resolved
is duplicated by MC-28609 Crash: java.lang.IllegalStateExceptio... Resolved
is duplicated by MC-28758 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-29352 HiDpi crash on startup in OS-X 10.8.3 Resolved
is duplicated by MC-29697 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-29834 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-30028 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-30074 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-30076 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-30142 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-30264 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31278 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31298 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31421 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31428 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31776 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31841 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-31866 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-32782 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-33142 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-33240 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-35329 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-35364 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-35505 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-36793 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-37205 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-37216 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-37220 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-37515 java.lang.IllegalStateException: Keyb... Resolved
is duplicated by MC-39561 Every time I play Minecraft, every 10... Resolved
is duplicated by MC-41443 Hopper: java.lang.IllegalStateExcepti... Resolved
is duplicated by MC-41599 I unplugged the usb radio for my wire... Resolved
is duplicated by MC-49143 Crash when going to full screen Resolved
is duplicated by MC-50430 Screen Lag Resolved
is duplicated by MC-52397 Full screen error, even after resetting Resolved
is duplicated by MC-55488 Fullscreen caused crash Resolved
is duplicated by MC-67672 IllegalStateException: Keyboard must ... Resolved
is duplicated by MC-70775 Crash when going fullscreen (F11) Resolved
is duplicated by MC-72185 Screen problem (Mouse Event not found... Resolved
is duplicated by MC-76464 F11 crashing game: Unexpected error ... Resolved
is duplicated by MC-79276 Crash when going in fullscreen (multi... Resolved
is duplicated by MC-81258 Fullscreen causes Crashes on Launch (... Resolved
is duplicated by MC-86576 Umm... Unexpected crash? Resolved
is duplicated by MC-88905 fullscreen display issues on secondar... Resolved
is duplicated by MC-90501 Minecraft crashes on fullscreen with ... Resolved
is duplicated by MC-92643 Fullscreen screen crash. Resolved
is duplicated by MC-94278 Going to fullscreen crash Resolved
is duplicated by MC-94309 Enable Full Screen Resolved
is duplicated by MC-99592 Crash when going fullscreen Resolved
is duplicated by MC-100839 Minecraft Crashes Whenever I Try to O... Resolved
is duplicated by MC-100985 I can't go no fullscreen Resolved
is duplicated by MC-101075 Fullscreen crash Resolved
is duplicated by MC-105266 Whenever trying to get in fullscreen,... Resolved
is duplicated by MC-112232 when i push f11 to go full screen the... Resolved
is duplicated by MC-113713 Minecraft going full screen on any ve... Resolved
is duplicated by MC-114324 Minecraft crash when i go to fullscreen Resolved
is duplicated by MC-114518 Minecraft crashes when I go fullscreen Resolved
is duplicated by MC-128117 Game crashes when going into fullscreen Resolved
Relates
relates to MC-19939 W7 sleep mode causes game to crash Resolved
relates to MC-90798 Minecraft crashes when the game is fu... Resolved
relates to MC-92318 Minecraft crashes when enabling fulls... Resolved
CHK:
Confirmation Status: Community Consensus

 Description   

The bug

Minecraft crashes when you toggle fullscreen mode.

Description: Updating screen events

java.lang.IllegalStateException: Keyboard must be created before you can read events
	at org.lwjgl.input.Keyboard.next(Keyboard.java:475)
	at bho.p(SourceFile:386)
	at bes.t(SourceFile:1586)
	at bes.av(SourceFile:970)
	at bes.a(SourceFile:398)
	at net.minecraft.client.main.Main.main(SourceFile:124)

Possible causes

This list contains some of the possible causes for this bug. It is not recommended to skip GPU driver updates or similar since it is not guaranteed that this is really causing this bug.

Workaround

This comment, this comment and MC-113713 suggest setting the refresh rate to exactly 60 hz fixes this problem.

Maybe: Comments in this reddit post suggest that resizing the window while the main menu is open before enabling fullscreen mode prevents this issue from happening.



 Comments   
Comment by Aaron Atkins [ 05/Dec/17 ]

I just realized that this bug is marked as fixed for a much older version, mine is 1.12. I'll post a new post.

Comment by Aaron Atkins [ 05/Dec/17 ]

I got a similar error (not exact but same problem, could not fullscreen) after my nVidia Driver updated for my 550ti. I was finally able to fix it by going into the nVidia settings and changing Scaling to Full-Screen instead of Aspect Ratio under "Adjust Desktop Size and Resolution". The Hertz was already at 60 by default. This was a temporary fix, however, as the game soon crashed with an "Out of Memory" error.

I actually got several intermittent errors before fullscreen stopped completely. The sound would not play at all about 50% of the time. I reinstalled Minecraft as a result, which for some reason changed the default JVM arguments to "-Xmx1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M" instead of the previous -"Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M". So, after I had fixed the video settings, I had to change my JVM arguments back (Actually bumped it a little to "-Xmx3G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn256M" after I confirmed it fixed the "Out of Memory issue"). Running with absolutely no issues now. I will note: I installed Minecraft with the onboard graphics the first time; installed the 550ti at a later time, so Minecraft may be applying the wrong arguments based on my system configuration.

I should note that I will now have to fix the JVM arguments with each there is a Minecraft update, as the JVM arguments still default to the previously defunct arguments with each new version I install. It even applied the arguments to Optifine when I attempted to install. Had I not kept a backup of the arguments for reference, I would have been completely at a loss.

Crash logs for reference.
crash-2017-12-04_15.28.59-client.txt crash-2017-12-04_15.45.57-client.txt

Comment by Greg [ 23/Jun/17 ]

Running Win 10 x64 with ATI R9 380 and was getting the same issue. Changed from VGA cable to HDMI and went from 60Hz to 50Hz on my monitor and now I can fullscreen.

Happy to give more info it it helps. Can repeat the steps and in Vanilla MC 1.12.

Comment by Daniel Ward [ 04/Mar/17 ]

Made some progress. I am on a 4K monitor. I was getting the error while at 1920x1080. If I change my resolution to the recommended resolution of 3840 x 2160 - the game works fine and I can switch between full screen and back without issues. I tried 2560 x 1440 and got the same issue... so it seems to be the same resolution.

UPDATE - seems to be related specifically to the hertz of the resolution. 3840 x 2160 is at 30hz .. the other resolutions are at 59hz .. (Standard PnP Monitor Driver). If I force the hertz to 60hz (thereby resetting resolution to 640x480) it works fine..

*FIXED!*
Finally! In windows, I went into Display Settings, then Advanced display settings, then Display adapter properties at the bottom (under Related settings). I then clicked on the List All Modes button. From there I was able to list all resolutions:

1920 by 1080, True Color (32 bit), 50 Hertz
1920 by 1080, True Color (32 bit), 59 Hertz
1920 by 1080, True Color (32 bit), 60 Hertz


By default it always went to 59 hertz - but I double clicked on the 60 Hertz line, then clicked Apply in the adapter properties window - tried it and it worked. Yay.

Comment by Daniel Ward [ 04/Mar/17 ]

I have been unable to enter full screen mode as well - but I am on a single display so I am not sure if MC-5520 applies.

I filled out my own bug report https://bugs.mojang.com/browse/MC-5520 but it was automatically tagged as a duplicate to MC-297 "Pixel Format not Accelerated" (which it is NOT a duplicate of)...

I downloaded Display Driver Uninstaller from Guru3D website and completely blew away my nVidia drivers in Safe Mode. I then installed the drivers from nVidia's website. I am STILL getting the same issue.

Again - not sure if it is the same bug as MC-5520 or not - but it does sound like the same errors.

Comment by snooozer [ 20/Sep/16 ]

Nope, happens on Windows as well.

Minecraft Version: 1.8.9
Operating System: Windows 10 (x86) version 10.0
CPU: 2x Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
Java Version: 1.8.0_25, Oracle Corporation

Comment by Fabian Röling [ 25/Jul/16 ]

Is this only on OS X?

Comment by Nick Russell [ 01/Jul/16 ]

I solved it for my case. I had my monitor's refresh rate set to 66 Hz. I set to 60 Hz and it goes fullscreen with no issues. Hopefully this helps some of you.

Comment by Carson C. [ 05/May/16 ]

I had this same problem in 1.8.9 with 2 monitors, I disconnected my secondary, started Minecraft, went into full screen and it didn't crash, then reconnected my secondary and it worked fine like normal again. Fixed!

Comment by Jozsef Augusztiny [ 23/Mar/16 ]

I just found a fix from 4 years ago by u/darkfalzx on the subreddit

"Here is how to fix it. I have the same exact issue. When you open minecraft, before pressing F11, resize your minecraft window (larger or smaller, it doesn't matter), then hit F11 - that's it. Enjoy."

source: https://www.reddit.com/r/Minecraft/comments/i22w2/rminecraft_please_help_me_whenever_i_press_f11_to/c20cjho

Comment by Nick Russell [ 13/Mar/16 ]

Any solutions yet? It's been 3 years and it's still effecting every version for me.

Comment by Noah Larkin [ 19/Aug/15 ]

Confirmed for 15w33c.

Comment by Engine Of Darkness [ 12/Jun/15 ]

This issue occured to me after updating my GPU Driver - I also only have one Monitor connected. There has to be anissue between the Game/ Driver, it certainly isn't due to lack of GPU Power on my Side - for me it also wasn't caused by Minecraft 1.8.7 (because I've already gone back to trying 1.8.4 which yielded the same crash)

More Details in my Ticket (marked as duplicate of this one here): https://bugs.mojang.com/browse/MC-81258

Comment by Lukas Wiklund [ 08/Jun/15 ]

Even if I keep having both monitors connected at all time.

Comment by Lukas Wiklund [ 08/Jun/15 ]

I also have this issue in 1.8.7

Comment by Brandon Staab [ 12/Jan/15 ]

Rotating your monitor output via Desktop>Screen Resolution>Orientation also has this affect

This implies that is is a Windows and iOS X problem

Comment by Galaxy_2Alex [ 25/Oct/14 ]

Reopened, thanks.

Comment by Leon [ 25/Oct/14 ]

Confirmed for 1.7.10, 1.8 and 1.8.1 Prerelease 1-3

Comment by Galaxy_2Alex [ 24/Oct/14 ]

Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 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 EAE01 [ 17/Jun/14 ]

Issue occurs on windows 8.1.1.
Experienced after removing second monitor connected via HDMI, Minecraft not running at time.

Comment by Josh Sararas [ 19/May/14 ]

Experiencing same issue on my girlfriend's laptop, no monitors were "added" or "removed" unless Windows 8 is being a derp. Below duplicate bug has links to the logs I submitted.

https://bugs.mojang.com/browse/MC-55488

Comment by Leon [ 05/May/14 ]

confirmed for Windows too. But i didn't added/removed a monitor

Comment by Brandon Espinoza [ 19/Feb/14 ]

I am having the same issue on version 1.7.4

Comment by Maarten Thijs [ 03/Nov/13 ]

nope it's still an issue, I just experienced it. But grum and dinnerbone. your crash system works perfectly!! my mc crashed and it send me straight to this page. hats off!

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

It would seem that this issue still occurs. See MC-30688.

Comment by [Mojang] Grum (Erik Broes) [ 14/Aug/13 ]

Very possibly fixed. There was a check for a keyboard state in a wrong location (smells like that was from old debug). Removed that hopefully that improves things

Comment by Akhorishaan [ 10/Jul/13 ]

Uploaded files for this crash in 1.6.2. Game crashes when you attempt to switch to fullscreen. More info on my particular setup here: MC-24527

Issue occurs even if there is no changing of monitors involved,

Comment by Jannis Froese [ 06/Jun/13 ]

I can confirm the bug on 13w22a with Windows 7 64bit, Java 8 (JRE b82)

Comment by [Mojang] Grum (Erik Broes) [ 02/Jun/13 ]

Does this happen on the latest snapshots?

Comment by James Clarke [ 17/Mar/13 ]

Just tested it, and it's still an issue in 1.5.

Comment by James Clarke [ 01/Mar/13 ]

Happens when coming out of fullscreen as well.

Comment by Tails [ 01/Mar/13 ]

Note:

java.lang.IllegalStateException: Keyboard must be created before you can read events
	at org.lwjgl.input.Keyboard.next(Keyboard.java:467)
	at aul.m(SourceFile:114)
	at net.minecraft.client.Minecraft.l(SourceFile:1086)
	at net.minecraft.client.Minecraft.J(SourceFile:582)
	at net.minecraft.client.Minecraft.run(SourceFile:534)
	at java.lang.Thread.run(Thread.java:680)
Comment by James Clarke [ 29/Dec/12 ]

Reproduced with 1.4.7 (unmodded).

Comment by [Bot] Spam Golem [ 29/Dec/12 ]

I could not find any existing issue that contains any of the crashes mentioned here. However, all of the crash reports that you have provided are from a modded version of Minecraft. Please try to reproduce the crash in a vanilla (non-modded) version of Minecraft and attach that report or this may be dismissed as being caused by a mod.

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