How to avoid delayed keyboard input?
in
Programming Questions
•
2 years ago
Say I have this code:
- void keyPressed() {
- if(keyCode==UP){
- player.y-=5;
- }
- }
This way the player moves up if I keep pressed the UP key.
The problem is when I first hit the key, the player goes up by 5px, then WAITS a bit, and then continues to move up.
Why he waits? How can I fix it? I'm sure is an input issue not a programming error. Is there a way to say to Procesing I don't want that delay?
Why he waits? How can I fix it? I'm sure is an input issue not a programming error. Is there a way to say to Procesing I don't want that delay?
1