@cartridge-engine/keyboard-engine
    Preparing search index...

    Interface PageBoundKeyEntry

    A key binding registered on a page (screen) layer.

    Extends BaseBoundKeyEntry with the page-only stopsWorkingAfterLayerAppearing option.

    interface PageBoundKeyEntry {
        actionId?: string;
        handler: KeyHandler;
        keys: string[];
        mode?: string;
        observer?: (remaining: number) => void;
        pressCount?: number;
        stopsWorkingAfterLayerAppearing?: boolean;
        times?: number;
        when?: string | (() => boolean);
    }

    Hierarchy (View Summary)

    Index
    actionId?: string

    The shortcut action id this binding was registered through, when the handler was given as an id rather than a callback.

    Kept so the action-key map can be cleaned up per registration: the resolved callback alone cannot tell which action a key belongs to, and a key may be bound by several actions at once.

    handler: KeyHandler

    Handler to invoke on match.

    keys: string[]

    Normalized key names to match.

    mode?: string

    Restrict this binding to a specific mode.

    Copied from BoundKeyboardOptions.mode at registration time. Checked by tryMatchBindings before when, onlyThis, and key-match evaluation. When the active mode does not match, the binding is skipped entirely.

    observer?: (remaining: number) => void

    Callback invoked on every key press while counting toward times. Receives the number of remaining presses before the handler fires. Requires times to be set; throws at registration otherwise.

    pressCount?: number

    Current press count. Managed internally by the keyboard provider.

    stopsWorkingAfterLayerAppearing?: boolean

    When true, this binding is skipped while a layer or modal layer is open: key presses matching it are silently ignored until every layer is closed, at which point it responds again.

    times?: number

    Number of presses needed before the handler fires (from options).

    when?: string | (() => boolean)

    Optional condition callback. When provided, the binding only fires if this callback returns true at the moment of the key press.

    When false, the binding is skipped as if it does not exist — the event continues to the next binding or layer.