Processing keypress (not presseD)
in
Programming Questions
•
1 year ago
I want to know if Processing can press a key on windows, the user is gonna use a kinect-like sensor to interact with some basic functions, we need to send key presses though. After some research, I found this "Robot" class, which seems to do exactly what I want, but maybe it's Arduino only?
I import the class with "import java.awt.Robot;", but on the line "r.keyPress(CAPS_LOCK);" I get this error:
Exception in thread "Animation Thread" java.lang.NullPointerException
at KeyPress.draw(KeyPress.java:40)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Win7 64 bits, Java 32 bits, default Processing install (only unzipped and ran), only extra library is SimpleOpenNI.
1