We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi ,have just lost five hours.in the end i found a line to input in terminal and now when i press a key and hold it it repeats! Even in Processing sketch! But but but, when i run my sketch and i hold down an arrow key it only registers it like a single keypressed so instead of redrawing with a new x y or z rotated angle it does it only once and i need to realese and press avain. I cannot get a continuous action.thanks a lot for your help ,am going crazy!!jeanclaude.
Answers
Am using Processing 3 by the way. Am a newcomer.
Am using the keyPressed() to handle the arrow keys.
Have reebooted the Mac BookPro as well
http://studio.ProcessingTogether.com/sp/pad/export/ro.91tcpPtI9LrXp
Have just done a mousePressed() function to do the same job and i ve the same problem i need to click!it s crazy!
https://processing.org/reference/keyPressed_.html
vs
https://processing.org/reference/keyPressed.html
the variable is true as long as the key is pressed.
the method is called ONCE when the key is pressed.
Can you post you code? It's easier to spot and point at the problem if you post some code.
Just like GoToLoop does in his example, you can use a boolean so that when the button is pressed your object will keep moving until the boolean is set to false, f.eks by releasing the key.
Thank you guys sorry for delay. In fact i an redwraing in the mouse pressed so i should redraw in the draw loop cnditioned by a boolean?do. Need to add a wai()?thanks i will chamge my programm and add the boolean and redraw in draw().i keep you informed.thanks again.jc.
Sorry in fact am redrawing in keyPressed()