Class MouseButtonEvent

java.lang.Object
com.jme3.input.event.InputEvent
com.jme3.input.event.MouseButtonEvent

public class MouseButtonEvent extends InputEvent
Mouse button press/release event.
  • Constructor Details

    • MouseButtonEvent

      public MouseButtonEvent(int btnIndex, boolean pressed, int x, int y)
  • Method Details

    • getButtonIndex

      public int getButtonIndex()
      Returns the mouse button index.

      See constants in MouseInput.

      Returns:
      the mouse button index.
    • isPressed

      public boolean isPressed()
      Returns true if the mouse button was pressed, false if it was released.
      Returns:
      true if the mouse button was pressed, false if it was released.
    • isReleased

      public boolean isReleased()
      Returns true if the mouse button was released, false if it was pressed.
      Returns:
      true if the mouse button was released, false if it was pressed.
    • getX

      public int getX()
      The X coordinate of the mouse when the event was generated.
      Returns:
      X coordinate of the mouse when the event was generated.
    • getY

      public int getY()
      The Y coordinate of the mouse when the event was generated.
      Returns:
      Y coordinate of the mouse when the event was generated.
    • toString

      public String toString()
      Overrides:
      toString in class Object