Skip to main content

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.

Breaking Change

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.

Not the same as the delegate method

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

ParameterTypeDescription
paramsStartSDKFocusManagementParamsSpecifies where the SDK should direct focus.

StartSDKFocusManagementParams

FieldTypeDescription
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.