A component that can hold keyboard focus (text inputs, key-capture rows). Focus is managed by UIFocus; while a focused component capturesKeyboard(), the host application must suppress its own keybinds (UIFocus.typing).

Methods

capturesKeyboard():Bool

true while this component wants raw typing (gates app keybinds).

onFocusGained():Void

Called when this component receives focus.

onFocusLost():Void

Called when focus moves elsewhere (or is cleared).

onKeyDown(keyCode:Int, charCode:Int, ctrl:Bool, shift:Bool, alt:Bool):Bool

A key event routed to the focused component.

Parameters:

keyCode

the platform key code

charCode

the printable character code (0 when none)

ctrl

true while a Control key is held

shift

true while a Shift key is held

alt

true while an Alt key is held

Returns:

true when consumed (the host should not process the key)