Event handling in Processing 2.0b7
in
Core Library Questions
•
10 months ago
I don't find a possibility to check the state of a mouse event. Registering works using
- registerMethod("mouseEvent", this);
But I did not find a solution to check the event type, which is defined like this:
-
public class MouseEvent extends Event { static public final int PRESS = 1; static public final int RELEASE = 2; static public final int CLICK = 3; static public final int DRAG = 4; static public final int MOVE = 5; static public final int ENTER = 6; static public final int EXIT = 7;
In earlier Processing versions, I could do a check like:
which is not possible any more. Only thing I can get is
- e.getNative();
This object is decribed like this:
So it seems not to be the best solution to use... Any ideas?
Get the platform-native event object. This might be the java.awt event on the desktop, though if you're using OpenGL on the desktop it'll be a NEWT event that JOGL uses. Android events are something else altogether. Bottom line, use this only if you know what you're doing, and don't make assumptions about the class type.
1