Class MouseEvent

java.lang.Object
processing.event.Event
processing.event.MouseEvent

public class MouseEvent extends Event
  • Field Details

  • Constructor Details

    • MouseEvent

      public MouseEvent(Object nativeObject, long millis, int action, int modifiers, int x, int y, int button, int count)
  • Method Details

    • getX

      public int getX()
    • getY

      public int getY()
    • getButton

      public int getButton()
      Which button was pressed, either LEFT, CENTER, or RIGHT.
    • getCount

      public int getCount()
      Number of clicks for mouse button events, or the number of steps (positive or negative depending on direction) for a mouse wheel event. Wheel events follow Java (see here), so getAmount() will return "negative values if the mouse wheel was rotated up or away from the user" and positive values in the other direction. On Mac OS X, this will be reversed when "natural" scrolling is enabled in System Preferences &rarr Mouse.
    • toString

      public String toString()
      Overrides:
      toString in class Object