klyn.gui.windows.Window.focusedWidget
property
public readonly property focusedWidget as Widget = null
Description

Current keyboard target, or null when no widget owns keyboard focus.

Updated before focus events, including requests made before show(). This reference lets composite widgets follow focus without searching their complete child trees during painting.

if window.focusedWidget is not null:
    print(window.focusedWidget.hasFocus)