Keyboard focus manager. Exactly one IUIFocusable holds focus; typing is the single flag host applications check before processing their own keybinds.

Static variables

@:value(null)staticread onlyfocused:IUIFocusable = null

The focused component, or null.

staticread onlytyping:Bool

true while the focused component captures raw typing.

Static methods

staticclear(?ifTarget:IUIFocusable):Void

Clears focus.

Parameters:

ifTarget

when set, only clears if that component currently holds focus

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

Routes a key event 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 the focused component consumed the key

staticset(target:IUIFocusable):Void

Moves focus (notifies the old and new holders).

Parameters:

target

the new focus holder, or null to blur