Focus boundary SG tree example
This app validates FocusBoundary focus enter and leave behavior when a TypeScript focus panel is inside a mixed BrightScript and TypeScript SceneGraph tree.
Purpose
Unlike the pure TypeScript focus-boundary examples, this app uses a BrightScript scene (MixedFocusScene) that owns the tree and hands key events and focus activation to a TypeScript anchor node (TsMiddlePanel, extending FocusBoundaryBase). The example shows that the TypeScript-driven focus model integrates with native SceneGraph focus: focus enters and leaves the TypeScript panel, and key events that the panel does not handle bubble back to BrightScript.
Summary
This example covers the following behaviors:
- BrightScript and TypeScript focus handoff through the
keyEventandfocusActiveinputs and thehandledKeysandfocusPathoutputs - A flat 2×2 grid (
navigationMap, without nesting) beside nestedFocusBoundarycomponents (Sidebar and Content) rememberLastFocusandonFocusGainedandonFocusLostcascades across nested boundaries- Edge keys (
upanddown) left unclaimed so they bubble to BrightScript for navigation between components - The
setFocusPathfunction ofRootFocusBoundary, which reports the active focus path
Development
To build, test, and lint the example, run these commands:
npx rk dev # Build + deploy to Roku device
pnpm test # Run tests
pnpm run lint # Lint sourcesUpdated about 6 hours ago
Did this page help you?