Key repeat function

I have implemented ball bouncing by boundary.

Keypressed function accept arrow key.

How to process keyrepeat when key is kept pressed. Keypressed is generated only when key is released and pressed again.

Appreciate any advice on the subject.

Try this in setup() :



Maybe using keyPressed and keyReleased to change a boolean state will help.
Here is the link to the key functions of processing (

Hope it helps :slight_smile:

This is a function keyPressed()

Use the boolean variable keyPressed in draw() instead

if (keypressed) …