I’m programming a program where it’s important to have access to many keyboard keys.
I add an KeyListener to the actual window. Now if the user presses an alphanumeric key on the keyboard the event keyPressed gets called once, how it also should be.
But if the user presses for example a dot, or another special char, the keyPressed event gets called very very often (as long as the key is hold down, it countinues to call the event)
If you want to know: I’m using Mac Os Lion 10.7.2 and Java 6.0.
Is it possible to avoid that often calling of the event?
These things are bound to give results like this coz for _ to appear you have to press Shift, so a
keyPressed(...)event is fired for Shift key too. Better use KeyBinding, for this scenario. Many keys like Delete, Escape will act differently than intended, withKeyListeners.