Class KeybindInput

java.lang.Object
me.hackware.api.gui.KeybindInput

public final class KeybindInput extends Object
Reusable borderless keybind recorder: a muted prefix label, then the combo as keycaps (a dashed ghost cap when unbound). Records PowerToys-style — click to arm, held modifiers preview live as keycaps, and the first non-modifier key (or a non-left mouse button) locks in the combo. Esc or clicking away cancels; the ✕ clears the binding.

Stateless about what it binds: the host supplies a KeybindInput.Target (which persists on change) and routes mouseClicked(double, double, int, me.hackware.api.gui.KeybindInput.Target) / keyPressed(int, int, me.hackware.api.gui.KeybindInput.Target).

  • Constructor Details

    • KeybindInput

      public KeybindInput()
  • Method Details

    • isRecording

      public boolean isRecording()
    • cancel

      public void cancel()
    • label

      public KeybindInput label(String s)
      Override the prefix label ("Keybind" by default).
    • render

      public void render(UiContext ui, int x, int y, int w, int h, KeybindInput.Target target)
    • mouseClicked

      public boolean mouseClicked(double mx, double my, int button, KeybindInput.Target target)
      Route the host's mouse press. Returns true if consumed.
    • keyPressed

      public boolean keyPressed(int key, int mods, KeybindInput.Target target)
      Route the host's key press. Returns true if consumed.