Random keyReleased() in KeyListener
I'm making a game in Java, and in the main code, i have a class that extends JComponent, and I add a custom KeyListener to it which passes all top-level key events to all of the entities that are active in the game. It works fine for the most part; all of the entities receive and respond correctly to the key events. The only problem is that sometimes I will get random keyReleased events followed directly by keyPressed events, almost like the component loses communication with the keyboard for a split second. This happens mostly with the Space key and the Left key, although it will occasionally happen with the Right key also. Any help is appreciated.