-
KeyEvents
Hi, in java when I am pressing a key down, it causes many key events to happen until the key is released.
My question now is how can I limit how many key events occur while the key is being pressed?
for example, if I am holding the A key down, my program should print the A key once every second until the A key is released.
Any help is always appreciated, thank you!
-
Re: KeyEvents
Some OSs have setings you can change to control that. Otherwise you'll have to program for it using the system's clock to see how frequently you want to react to the event.
See the System class for methods to get the current time.