startFocusManagement
Hands focus from your application into the SDK panel UI.
Overview
Call startFocusManagement on the event instance when the user navigates from
your application's UI into the Maestro panel or overlay, so the SDK takes control of
directional (D-pad/remote) focus within its own UI.
The toTarget parameter is now required. Calls without an argument will fail to
compile. Pass { toTarget: 'sidebar' } for panel navigation or { toTarget: 'overlay' }
when handing focus to the overlay. The method now returns void synchronously —
remove any await at call sites.
This is the app → SDK direction. There is also an
IMaestroEventDelegate.startFocusManagement()
callback that runs in the opposite direction (SDK → app): the SDK calls it
to hand focus back to your application. The two share a name but are different
methods on different interfaces. See the Focus Management guide for the full flow.
Method Signature
startFocusManagement(params: StartSDKFocusManagementParams): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
params | StartSDKFocusManagementParams | Specifies where the SDK should direct focus. |
StartSDKFocusManagementParams
| Field | Type | Description |
|---|---|---|
toTarget | 'overlay' \| 'sidebar' | The SDK UI target that should receive focus. Pass 'sidebar' for the panel and 'overlay' for the overlay. |
Return Value
This method does not return a value.
Example
const event = SDK.getMaestroEventViewModel();
// Hand focus to the SDK panel (sidebar).
(document.activeElement as HTMLElement)?.blur();
event.startFocusManagement({ toTarget: 'sidebar' });
// Or hand focus to the overlay.
event.startFocusManagement({ toTarget: 'overlay' });
Notes
- Call this method before the user's keypress navigates into the SDK UI so that focus lands correctly.
- The SDK calls
IMaestroEventDelegate.startFocusManagement()in the opposite direction when returning focus to your application.