Hello!
I’d like to play with Processing, but I’d favor using IntelliJ rather than the custom IDE.
I’ve managed to get a basic project running, however the key events don’t seem to register.
Here’s a minimal example.
import processing.core.PApplet;
public class Main extends PApplet {
@Override
public void setup() {
background(0);
System.out.println("setup!");
super.setup();
}
@Override
public void draw() {
stroke(0, 0, 255);
fill(255, 0, 0);
circle((float) width /2, (float) height /2, 20);
super.draw();
}
@Override
public void keyPressed() {
System.out.println("keyPressed!");
super.keyPressed();
}
public static void main(String[] args) {
PApplet.main("Main");
}
}
I can see the drawing alright, but my program doesn’t register any key strokes and only prints:
setup!
Process finished with exit code 0 // <-- once I manually closed the window
The starter project is available here: nature-of-code/_basic_setup/java/processing_maven at 1accab0e10c7795c681111d644678d106ec47120 · benjamin-thomas/nature-of-code · GitHub
I also built a new project without maven, and manually referenced core.jar
from my downloaded processing-4.2
folder: same result - I can see no key being registered.
Can anybody enlighten me?