Class MouseInput

java.lang.Object
technology.sola.engine.input.MouseInput

@NullMarked public class MouseInput extends Object
MouseInput contains information about user interaction with the mouse.
  • Constructor Details

    • MouseInput

      public MouseInput()
  • Method Details

    • isMousePressed

      public boolean isMousePressed(MouseButton mouseButton)
      Checks if a MouseButton is pressed or not.
      Parameters:
      mouseButton - the button to check
      Returns:
      true if mouse button is pressed
    • isMouseDragged

      public boolean isMouseDragged(MouseButton mouseButton)
      Checks if a MouseButton is being dragged or not.
      Parameters:
      mouseButton - the button to check
      Returns:
      true if mouse button is being dragged
    • getMousePosition

      public @Nullable Vector2D getMousePosition()
      Returns:
      the current position of the mouse on screen
    • getMouseWheel

      public MouseWheelEvent getMouseWheel()
      Returns the last MouseWheelEvent that was received. Defaults to MouseWheelEvent.NONE if there was no mouse wheel event this frame.
      Returns:
      the last mouse wheel event
    • updateStatusOfMouse

      public void updateStatusOfMouse()
      Called once per frame to update the current status of the mouse based on the user's interaction.
    • onMouseMoved

      public void onMouseMoved(MouseEvent mouseEvent)
      Called on move of the mouse.
      Parameters:
      mouseEvent - the MouseEvent
    • onMousePressed

      public void onMousePressed(MouseEvent mouseEvent)
      Called on press of a mouse button.
      Parameters:
      mouseEvent - the MouseEvent
    • onMouseReleased

      public void onMouseReleased(MouseEvent mouseEvent)
      Called on release of a mouse button.
      Parameters:
      mouseEvent - the MouseEvent
    • onMouseWheel

      public void onMouseWheel(MouseWheelEvent mouseWheelEvent)
      Captures the last MouseWheelEvent that happened.
      Parameters:
      mouseWheelEvent - the last mouse wheel event that happened