Class GuiEventProvider

All Implemented Interfaces:
ElementEvents, GuiParent<GuiEventProvider>, TooltipHandler<GuiEventProvider>

public class GuiEventProvider extends GuiElement<GuiEventProvider>
Created by brandon3055 on 15/11/2023
  • Constructor Details

    • GuiEventProvider

      public GuiEventProvider(@NotNull @NotNull GuiParent<?> parent)
  • Method Details

    • setIgnoreConsumed

      public GuiEventProvider setIgnoreConsumed(boolean ignoreConsumed)
    • onMouseClick

      public GuiEventProvider onMouseClick(org.apache.logging.log4j.util.TriConsumer<Double,Double,Integer> listener)
    • onMouseRelease

      public GuiEventProvider onMouseRelease(org.apache.logging.log4j.util.TriConsumer<Double,Double,Integer> listener)
    • onMouseMove

      public GuiEventProvider onMouseMove(BiConsumer<Double,Double> listener)
    • onScroll

      public GuiEventProvider onScroll(org.apache.logging.log4j.util.TriConsumer<Double,Double,Double> listener)
    • onKeyPress

      public GuiEventProvider onKeyPress(org.apache.logging.log4j.util.TriConsumer<Integer,Integer,Integer> listener)
    • onKeyRelease

      public GuiEventProvider onKeyRelease(org.apache.logging.log4j.util.TriConsumer<Integer,Integer,Integer> listener)
    • onCharTyped

      public GuiEventProvider onCharTyped(BiConsumer<Character,Integer> listener)
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseClick event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseClick handling should be implemented via ElementEvents.mouseClicked(double, double, int)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      mouseX - Mouse X position
      mouseY - Mouse Y position
      button - Mouse Button
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int button, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseReleased event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseReleased handling should be implemented via ElementEvents.mouseReleased(double, double, int)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      mouseX - Mouse X position
      mouseY - Mouse Y position
      button - Mouse Button
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Description copied from interface: ElementEvents
      Called whenever the cursor position changes. Vanillas mouseDragged is not passed through because it is redundant. All mouse drag functionality can be archived using available events.
      Parameters:
      mouseX - new mouse X position
      mouseY - new mouse Y position
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scroll, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseScrolled event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseScrolled handling should be implemented via ElementEvents.mouseScrolled(double, double, double)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      mouseX - Mouse X position
      mouseY - Mouse Y position
      scroll - Scroll direction and amount
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • keyPressed

      public boolean keyPressed(int key, int scancode, int modifiers, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for keyPressed event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of keyPressed handling should be implemented via ElementEvents.keyPressed(int, int, int)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      key - the keyboard key that was pressed.
      scancode - the system-specific scancode of the key
      modifiers - bitfield describing which modifier keys were held down.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • keyReleased

      public boolean keyReleased(int key, int scancode, int modifiers, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for keyReleased event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of keyReleased handling should be implemented via ElementEvents.keyReleased(int, int, int)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      key - the keyboard key that was released.
      scancode - the system-specific scancode of the key
      modifiers - bitfield describing which modifier keys were held down.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • charTyped

      public boolean charTyped(char character, int modifiers, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for charTyped event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of charTyped handling should be implemented via ElementEvents.charTyped(char, int)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      character - The character typed.
      modifiers - bitfield describing which modifier keys were held down.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.