Sluggish input response with long key presses
This isn't unique to Java3D, but I've noticed that key processing is slugglish when a key is held down. This is especially frustrating for games. I've noticed this both when I listen for a KeyEvent using the traditional KeyListener.keyPressed() method for 2D games and when using Behaviors with Java3D. With Java3D, I subclass Behavior, register a WakeupOnAWTEvent(KeyEvent.PRESSED), and process events from the Behavior.processStimulus() method.
When a key is held down, say when a player wants to keep moving forward, it takes about 1 second for the system to respond to the initial key press. After the initial delay, things proceed normally, but the delay is annoying for the user, especially if the user wants to change direction quickly. If I just "tap" the key, then key processing proceeds without delay.
Am I doing something wrong? Should I be processing the events differently for these long, continuous key presses? I've programmed before using DirectX, and you were able to manually "poll" the keyboard and doing this in the main game loop avoided this sluggish input problem (but of course programming with DirectX was generally otherwise a pain :-).