get-focus-window in top-level-window<%>

Returns the window that has the keyboard focus, either the top-level window or one of its children. If neither the window nor any of its children has the focus, #f is returned.

See also get-edit-target-window and get-focus-object.