Interface GuiInput


public interface GuiInput
Input services for an open GUI.
  • Method Details

    • setCursor

      void setCursor(GuiCursor cursor)
      Sets the cursor for this frame. Each frame starts with GuiCursor.DEFAULT.
    • clipboard

      String clipboard()
      Returns:
      Clipboard text, or an empty string
    • setClipboard

      void setClipboard(String text)
    • isKeyDown

      boolean isKeyDown(int key)
    • isButtonDown

      boolean isButtonDown(int button)
    • captureBind

      void captureBind(Consumer<Bind> onBind)
      Waits for the next key or mouse button and passes it to onBind. Escape gives a cleared bind (new Bind(false, -1)). Other input is held back meanwhile.
    • captureBind

      void captureBind(Consumer<Bind> onBind, Supplier<Rect> area)
      Like captureBind(Consumer), but only a mouse press inside area becomes the bind. A press outside it ends the wait and is handled as a normal click.
      Parameters:
      area - Where mouse presses bind, read at each press
    • cancelBindCapture

      void cancelBindCapture()
    • bindName

      String bindName(Bind bind)
      Returns:
      A bind as Boze shows it, such as R, Mouse 4 or an empty string for no bind
    • clickSound

      void clickSound()
      Plays the click Boze's own GUI plays when something is pressed.
    • isCapturingBind

      boolean isCapturingBind()
    • beginDrag

      void beginDrag(GuiDrag drag)
      Sends mouse movement to drag until the button is released.
    • endDrag

      void endDrag()
    • isDragging

      boolean isDragging()