Class MouseButton

java.lang.Object
com.luciad.input.mouse.MouseButton

public class MouseButton extends Object
Represents a mouse button in the controller API.
  • Field Details

    • Unknown

      public static final MouseButton Unknown
      Returns an unknown mouse button.
    • Left

      public static final MouseButton Left
      Returns the left mouse button.
    • Middle

      public static final MouseButton Middle
      Returns the middle mouse button.
  • Constructor Details

    • MouseButton

      public MouseButton(long index)
      Creates a new MouseButton with the given index.

      The mouse button index maps to mouse buttons as follows:

      • 0 => unknown button
      • 1 => left mouse button (primary button)
      • 2 => middle mouse button
      • 3 => right mouse button

      Unmapped values can be used to express a custom mouse button.

      Parameters:
      index - the mouse button index.
  • Method Details

    • getIndex

      public long getIndex()
      The mouse button index.
    • isUnknown

      public boolean isUnknown()
      Returns whether the button is unknown.
      Returns:
      whether the button is unknown.
    • isLeft

      public boolean isLeft()
      Returns whether the button is the left mouse button.
      Returns:
      whether the button is the left mouse button.
    • isMiddle

      public boolean isMiddle()
      Returns whether the button is the middle mouse button.
      Returns:
      whether the button is the middle mouse button.
    • isRight

      public boolean isRight()
      Returns whether the button is the right mouse button.
      Returns:
      whether the button is the right mouse button.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object