Package input

Class Mouse

java.lang.Object
input.Mouse

public class Mouse extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.joml.Vector2f
    Position of the mouse
    static boolean[]
    Array for storing states for mouse buttons
    static boolean
    Is the mouse being dragged
    static org.joml.Vector2f
    Mouse Scrolling Values
    static long
    X Position of the mouse
    static long
    Y Position of the mouse
    static org.joml.Vector2f
    Position of the mouse on the previous frame
    static long
    X Position of the mouse on the previous frame
    static long
    Y Position of the mouse on the previous frame
    static float
    Mouse Scrolling in X-axis.
    static float
    Mouse Scrolling in Y-axis.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Clear the mouse state
    static boolean
    mouseButtonDown(int button)
    Get if the queried button is pressed
    static void
    Apply the latest changes to the mouseButton array
    static void
    Subscribes to mouse scroll event and mouse button event
    static void
    Called each frame to update mouse button states and mouse position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mouse

      public static org.joml.Vector2f mouse
      Position of the mouse
    • mouseX

      public static long mouseX
      X Position of the mouse
    • mouseY

      public static long mouseY
      Y Position of the mouse
    • pmouse

      public static org.joml.Vector2f pmouse
      Position of the mouse on the previous frame
    • pmouseX

      public static long pmouseX
      X Position of the mouse on the previous frame
    • pmouseY

      public static long pmouseY
      Y Position of the mouse on the previous frame
    • mouseScroll

      public static org.joml.Vector2f mouseScroll
      Mouse Scrolling Values
    • scrollX

      public static float scrollX
      Mouse Scrolling in X-axis.
    • scrollY

      public static float scrollY
      Mouse Scrolling in Y-axis.
    • mouseButton

      public static boolean[] mouseButton
      Array for storing states for mouse buttons
    • mouseDragged

      public static boolean mouseDragged
      Is the mouse being dragged
  • Constructor Details

    • Mouse

      public Mouse()
  • Method Details

    • pollMouseButtons

      public static void pollMouseButtons()
      Apply the latest changes to the mouseButton array
    • setupCallbacks

      public static void setupCallbacks()
      Subscribes to mouse scroll event and mouse button event
    • update

      public static void update()
      Called each frame to update mouse button states and mouse position.
    • mouseButtonDown

      public static boolean mouseButtonDown(int button)
      Get if the queried button is pressed
      Parameters:
      button - The button. Check input/Buttons.java
      Returns:
      Returns whether the button is currently pressed.
    • clearMouseInput

      public static void clearMouseInput()
      Clear the mouse state