Skip to content

UIFocusStack

Defined in: ui/src/focus/UIFocusStack.ts:20

Every focus scope in one scene, and which of them reads input.

A scope shows and hides with its own subtree, so this is not a push/pop list: each frame it records which scopes are shown and gives input to the innermost one. Hiding a dialog inside a menu hands the keys back to the menu, on the row it had.

new UIFocusStack(): UIFocusStack

UIFocusStack

get active(): UIFocusScope | null

Defined in: ui/src/focus/UIFocusStack.ts:26

The scope reading input, or null while none is shown.

UIFocusScope | null

_drive(input): void

Defined in: ui/src/focus/UIFocusStack.ts:72

Internal

Give input to the innermost scope shown and run its frame. A scope holding a shown scope inside it stands aside. Among the rest, the one shown most recently wins, and two shown in the same frame rank in registration order.

UIFocusInputSource | null

void


_hasDeviceScope(): boolean

Defined in: ui/src/focus/UIFocusStack.ts:102

Internal

Whether any shown scope reads a device.

boolean


_observe(): boolean

Defined in: ui/src/focus/UIFocusStack.ts:51

Internal

Recompute which scopes are shown, stamping each one that just became shown, and report whether any is. Runs for every scene each frame, driven or not, so a menu shown under a pushed scene gets its stamp that frame.

boolean


_register(scope): void

Defined in: ui/src/focus/UIFocusStack.ts:31

Internal

UIFocusScope

void


_suspend(): void

Defined in: ui/src/focus/UIFocusStack.ts:95

Internal

Take input away from whatever holds it, dropping its latch.

void


_unregister(scope): void

Defined in: ui/src/focus/UIFocusStack.ts:36

Internal

UIFocusScope

void


destroy(): void

Defined in: ui/src/focus/UIFocusStack.ts:109

Forget every scope. Called when the owning scene exits.

void

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/ui.md.