Loading...
Logo
Processing Forum
Just stumbled upon a strange problem: The function keyPressed() is not getting called when using Eclipse.

My class looks like this:


Copy code
  1. package MyPackage;
  2. public class MyClass extends PApplet{
  3.       public static void main(String[] args){
  4.             PApplet.main(new String[] {"MyPackage.MyClass" });
  5.       }
  6.       @Override
  7.       public void setup(){
  8.             println("println working");
  9.       }
  10.       @Override
  11.       public void keyPressed(){
  12.             println("println not working");
  13.       }
  14. }

Anybody can help me? I'm really confused right now...
Thanks,
Tim




Replies(2)

You need to add a draw() method without that there is no event handling loop.

Thanks so much quarks! Adding a draw function works!