java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.util.TInputContext

public final class TInputContext extends Object
Holds the information about a given user input.
  • Method Details

    • getInputType

      public final TInputContext.InputType getInputType()
    • getKeyboardKey

      @Nullable public final @Nullable TInputContext.InputKeyboardKey getKeyboardKey()
    • getTypedChar

      @Nullable public final @Nullable Character getTypedChar()
    • getMouseButton

      @Nullable public final @Nullable Integer getMouseButton()
    • getMousePosition

      @Nullable public final Point2D.Double getMousePosition()
    • getMouseDelta

      @Nullable public final Point2D.Double getMouseDelta()
    • getScrollAmount

      @Nullable public final Point2D.Double getScrollAmount()
    • ofKeyboardPR

      public static TInputContext ofKeyboardPR(TInputContext.InputKeyboardKey key, boolean isDown)
      "Of keyboard press/release".
      Parameters:
      key - The TInputContext.InputKeyboardKey that was pressed or released.
      isDown - true = TInputContext.InputType.KEY_PRESS; false = TInputContext.InputType.KEY_RELEASE.
    • ofCharType

      public static TInputContext ofCharType(char character, int modifiers)
      "Of character type"
      Parameters:
      character - The Character the user typed.
      modifiers - The character modifiers.
    • ofMouseCR

      public static TInputContext ofMouseCR(int mouseButton, boolean isDown)
      "Of mouse click/release".
      Parameters:
      mouseButton - The mouse button that was clicked or released.
      isDown - true = TInputContext.InputType.MOUSE_PRESS; false = TInputContext.InputType.MOUSE_RELEASE
    • ofMouseMove

      public static TInputContext ofMouseMove(double mouseX, double mouseY)
    • ofMouseDrag

      public static TInputContext ofMouseDrag(double mouseX, double mouseY, double deltaX, double deltaY, int mouseButton)
      "Of mouse drag"
      Parameters:
      mouseButton - The mouse button that was clicked when the dragging first started.
    • ofMouseDragEnd

      public static TInputContext ofMouseDragEnd(int mouseButton)
      "Of mouse drag end"
      Only invoked on elements that were previously being dragged and no longer are.
      Parameters:
      mouseButton - The mouse button that was clicked when the dragging first started.
    • ofMouseScroll

      public static TInputContext ofMouseScroll(double mouseX, double mouseY, double vAmount)
    • ofMouseScroll

      public static TInputContext ofMouseScroll(double mouseX, double mouseY, double hAmount, double vAmount)