Hosanna UI API v1.30.2-next
    Preparing search index...

    Interface representing the focus manager, responsible for managing focus transitions, handling key events, and providing debug utilities for focus management.

    interface IFocusManager {
        focusedView?: IFocusable;
        isAppLaunching: boolean;
        isLockedOnNativeRenderer: boolean;
        nativeFocusedRenderer?: ISGNNode;
        navigationRepeatIntervalMs: number;
        _setFocusLocked(newFocus: IFocusable): void;
        _setFocusUnlocked(): void;
        _tick(): void;
        _toggleDebugView(): void;
        addDebugView(): void;
        handleInputEvent(event: HsInputEvent): boolean;
        resetFocus(): void;
        setFocus(
            newFocus: IFocusable,
            forced?: boolean,
            focusSource?: FocusChangeSource,
        ): IOperationResult;
        setNativeFocus(renderer?: ISGNNode): void;
        setNavigationRepeatInterval(intervalMs: number): void;
    }

    Implemented by

    Index

    Properties

    focusedView?: IFocusable

    The currently focused view.

    isAppLaunching: boolean
    isLockedOnNativeRenderer: boolean

    Indicates whether the focus is locked on the native renderer.

    nativeFocusedRenderer?: ISGNNode

    The native SceneGraph node that currently has platform focus (e.g. Roku focusedChild). Optional; not all implementations may expose this.

    navigationRepeatIntervalMs: number

    Minimum interval between repeated directional focus moves during a long press.

    Methods

    • Locks focus on the specified focusable element (internal use only).

      Parameters

      • newFocus: IFocusable

        The element to lock focus on.

      Returns void

    • Unlocks focus, allowing focus transitions (internal use only).

      Returns void

    • Internal method to handle periodic updates for focus management.

      Returns void

    • Toggles the visibility of the debug view (internal use only).

      Returns void

    • Adds a debug view for visualizing focus transitions and states.

      Returns void

    • Resets the focus state to its initial state.

      Returns void

    • Sets focus to the specified focusable element.

      Parameters

      • newFocus: IFocusable

        The element to focus on.

      • Optionalforced: boolean

        Whether to force the focus change, even if focus is locked (default: false).

      • OptionalfocusSource: FocusChangeSource

      Returns IOperationResult

      An operation result indicating success or failure.

    • Sets the native focus on the specified renderer.

      Parameters

      • Optionalrenderer: ISGNNode

        The renderer to set focus on.

      Returns void

    • Configures the minimum interval between repeated directional focus moves during a long press.

      Parameters

      • intervalMs: number

        The interval in milliseconds. Values below 0 are treated as 0.

      Returns void