Missing key strokes with JMEDektop

If you type quite fast in a JTextField with ~70FPS it looses key strokes. I guess the key strokes are lost between updates. Has anybody experienced the same? Maybe I have a bug in my input handler.

If it's a general problem: Is there a way to get all keyboard events?

1 Like

Yes, it's a bug in JMEDesktop that has no work-around to my knowledge currently.  I think Irrisor had plans of going back and re-architecting the way the input works but just hasn't gotten around to it yet. Although I often confuse reality with desire. :-p

Irrisor, would you like to comment on this?


I think you are wrong here twice, darkfrog. It's not a bug in JMEDesktop but a shortcoming of lwjgl input afaik. And I don't plan on redesigning that ;).

Well, I guess this is just to make up for the majority of the times when I'm right.  :roll:

Of course one man's "short-coming" is another man's bug…but I would expect there's a way around that problem.  What if we were to create a separate thread that was simply in charge of listening for keyboard events and throwing them to the AWT event handler system instead of relying on the graphical thread as I would assume the delay in loops is what causes that key pressing issue?


1 Like

Good news - I just made a little test: lwjgl is not the one to blame. It's the jME InputHandler :-o (written by me )

I'm definately going to fix it. Not sure if I can today…

1 Like

Ok that was easier than I expected -> fixed. Only problem that remains with lwjgl input is that it does not report modifiers correctly (e.g. upper and lower case). So 'shift' and alike must be hold down at least one frame :expressionless:

1 Like

Still a major improvement over what it was…thanks buddy! :slight_smile:


:-o I wanted to use that for the chat system.

Are there any ideas for a workaround?

darkfrog: Yes, I think another thread could help but then keyboard event generation would be independent on lwjgl, right?

1 Like

Wow, that was fast.

I just tried the latest CVS and it works fine.

I just discovered another problem: Several key strokes do not appear in a JTextField in JMEDesktop. Among these are  :  < > ?

Using a german keyboard, I assume? So do I, and most of these work fine with me. However, with the "<>|" key, which is left to the space bar on my keyboard, I get the following warning:

19.03.2006 12:30:49 com.jmex.awt.input.AWTKeyInput toAWTCode
WARNUNG: unsupported key:86

The rest of the keys you mention work on my system, however. Do you get any similar warnings?

Oh, you're right. I get several warnings, but for much more keys:

19.03.2006 00:46:50 com.jmex.awt.input.AWTKeyInput toAWTCode

WARNUNG: unsupported key:0

In com.jmex.awt.input.AWTKeyInput there is a mapping and the key code is missing there according to the error message. This should be easy to fix. What I don't understand is, why do I get key code 0 all the time?

I have committed a fix to allow even unknown keycodes to work with JMEDesktop (if Swing knows them, of course). Please check if that solves your problems.


Are there any plans to implement support for typematic repeat?  That's probably the only really common problem I've seen left having to do with keyboard events.


darkfrog said:

Are there any plans to implement support for typematic repeat?  That's probably the only really common problem I've seen left having to do with keyboard events.

Well would be nice to have - but no actual plans yet.
I'm not even sure where this should go - into lwjgl? into jME input handler? or only into JMEDesktop? :|
1 Like

A good point.  :-o

1 Like