Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

registerMethod() of keyEvent not compiling in custom library...

$
0
0

I'm trying to add some useful keyboard functions to my XYscope library and hitting a strange problem within Eclipse to use a registerMethod() and keyEvent.

In the initialization of the library class, I'm calling the registerMethod() which works: p.registerMethod("keyEvent", this);

but I can only compile successfully if I create a public function of keyEvent without any parameters inside:

public void keyEvent(){ p.println("test"); }

however when trying to run a sketch using the library in Processing, I get this error: "There is no public keyEvent() method in the class xyscope.XYscope"

If I try to include the KeyEvent parameter like I've read about, the library won't compile:

public void keyEvent(KeyEvent evt){ p.println("test"); }

The error I get while trying to compile is such:

102: error: cannot find symbol [javac] public void keyEvent(KeyEvent evt){ [javac] ^ [javac] symbol: class KeyEvent [javac] location: class XYscope

Any ideas out there what I might be doing wrong?


Viewing all articles
Browse latest Browse all 2896

Trending Articles