Package me.hackware.api.gui
Class KeybindInput
java.lang.Object
me.hackware.api.gui.KeybindInput
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWhat the recorder reads from and writes to; implementations persist changes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()booleanbooleankeyPressed(int key, int mods, KeybindInput.Target target) Route the host's key press.Override the prefix label ("Keybind" by default).booleanmouseClicked(double mx, double my, int button, KeybindInput.Target target) Route the host's mouse press.voidrender(UiContext ui, int x, int y, int w, int h, KeybindInput.Target target)
-
Constructor Details
-
KeybindInput
public KeybindInput()
-
-
Method Details
-
isRecording
public boolean isRecording() -
cancel
public void cancel() -
label
Override the prefix label ("Keybind" by default). -
render
-
mouseClicked
Route the host's mouse press. Returns true if consumed. -
keyPressed
Route the host's key press. Returns true if consumed.
-