Alt-tab disables key input in JMEDesktop (Windows XP)

Alt-tab disables key input in JMEDesktop (Windows XP)

To reproduce this bug:

Start TestJMEDesktop,

press alt-tab to switch to another program,

switch back to TestJMEDesktop,

click in one of the text fields,

try to type something.

I don't really use jmedesktop, but I have noticed that alt tabbing can leave a key stuck (because the release happens when we don't have focus.)

Testing… yeah, sure enough, if you hit alt and release it, you can type again.  I solved a similar thing like this in my own code by adding a class that monitors the DisplaySystem's isActive flag and when it goes false, I clear the KeyInput and MouseInput.


Good idea! How did you monitor isActive()? Polling in update? , polling in a new thread?

How about creating an interface DisplaySystemListener or something? Could be good to be able to hook up on for other reasons as well.

Sure, I'll look at making my solution generic.