Loading...
Logo
Processing Forum
I don't find a possibility to check the state of a mouse event. Registering works using
Copy code
  1. registerMethod("mouseEvent", this);
But I did not find a solution to check the event type, which is defined like this:
Copy code
  1. 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:
Copy code
  1.  switch (event.getID()) { case MouseEvent.MOUSE_PRESSED:
which is not possible any more. Only thing I can get is 
Copy code
  1. e.getNative();
This object is decribed like this:

  • 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.
So it seems not to be the best solution to use... Any ideas?






Replies(2)


getAction()
MouseEvent.PRESS

read the code on svn I did...