Class InputEvent.MouseScrollingEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.InputEvent
net.neoforged.neoforge.client.event.InputEvent.MouseScrollingEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
InputEvent

public static class InputEvent.MouseScrollingEvent extends InputEvent implements net.neoforged.bus.api.ICancellableEvent
Fired when a mouse scroll wheel is used outside of a screen and a player is loaded, before being processed by vanilla.

This event is cancellable, and does not have a result. If the event is cancelled, then the mouse scroll event will not be processed further.

This event is fired on the main Forge event bus, only on the logical client.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.InputEvent

    InputEvent.InteractionKeyMappingTriggered, InputEvent.Key, InputEvent.MouseButton, InputEvent.MouseScrollingEvent

    Nested classes/interfaces inherited from class net.neoforged.bus.api.Event

    net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
     
    private final boolean
     
    private final double
     
    private final double
     
    private final boolean
     
    private final double
     
    private final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MouseScrollingEvent(double scrollDeltaX, double scrollDeltaY, boolean leftDown, boolean middleDown, boolean rightDown, double mouseX, double mouseY)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the X position of the mouse cursor.
    double
    Returns the Y position of the mouse cursor.
    double
    Returns the amount of change / delta of the mouse scroll on the X axis.
    double
    Returns the amount of change / delta of the mouse scroll on the Y axis.
    boolean
    Returns true if the left mouse button is pressed.
    boolean
    Returns true if the middle mouse button is pressed.
    boolean
    Returns true if the right mouse button is pressed.

    Methods inherited from class net.neoforged.bus.api.Event

    getResult, hasResult, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.bus.api.ICancellableEvent

    isCanceled, setCanceled
  • Field Details

    • scrollDeltaX

      private final double scrollDeltaX
    • scrollDeltaY

      private final double scrollDeltaY
    • mouseX

      private final double mouseX
    • mouseY

      private final double mouseY
    • leftDown

      private final boolean leftDown
    • middleDown

      private final boolean middleDown
    • rightDown

      private final boolean rightDown
  • Constructor Details

    • MouseScrollingEvent

      @Internal public MouseScrollingEvent(double scrollDeltaX, double scrollDeltaY, boolean leftDown, boolean middleDown, boolean rightDown, double mouseX, double mouseY)
  • Method Details

    • getScrollDeltaX

      public double getScrollDeltaX()
      Returns the amount of change / delta of the mouse scroll on the X axis.
      Returns:
      the amount of change / delta of the mouse scroll on the X axis
    • getScrollDeltaY

      public double getScrollDeltaY()
      Returns the amount of change / delta of the mouse scroll on the Y axis.
      Returns:
      the amount of change / delta of the mouse scroll on the Y axis
    • isLeftDown

      public boolean isLeftDown()
      Returns true if the left mouse button is pressed.
      Returns:
      true if the left mouse button is pressed
    • isRightDown

      public boolean isRightDown()
      Returns true if the right mouse button is pressed.
      Returns:
      true if the right mouse button is pressed
    • isMiddleDown

      public boolean isMiddleDown()
      Returns true if the middle mouse button is pressed.
      Returns:
      true if the middle mouse button is pressed
    • getMouseX

      public double getMouseX()
      Returns the X position of the mouse cursor.
      Returns:
      the X position of the mouse cursor
    • getMouseY

      public double getMouseY()
      Returns the Y position of the mouse cursor.
      Returns:
      the Y position of the mouse cursor