A key-binding row: label left, binding box right showing the current key. Clicking the box
enters listening mode (UIFocus.typing gates the host's keybinds automatically); the next
key pressed becomes the binding and fires onChange(keyCode). Escape cancels; with
allowClear on, Backspace/Delete clears the binding (fires onChange(-1)) — disable
allowClear to make those keys bindable. Works on mobile only with a hardware keyboard
attached; desktop-oriented.
Static methods
statickeyName(code:Int):String
A short display name for a key code (letters, digits, numpad, F-keys, navigation and
common punctuation; unknown codes render as #<code>).
Parameters:
code | the platform key code |
|---|
Returns:
the display name
Constructor
new(label:String, width:Float, keyCode:Int = -1, ?onChange:Int ‑> Void)
Parameters:
label | the row text on the left |
|---|---|
width | layout width (the binding box sits at the right edge) |
keyCode | the initial binding (-1 = unbound) |
onChange | fired with the new key code on rebind/clear |
Variables
filter:(keyCode:Int) ‑> Bool = null
Optional code filter; return false to reject a key while listening.
Methods
localize(key:String, fallback:String):Void
Switches the label to a localized string.
Parameters:
key | the translation key |
|---|---|
fallback | the source-language text |
setBinding(code:Int):Void
Programmatically sets the binding without firing onChange.
Parameters:
code | the key code (-1 = unbound) |
|---|