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

    Interface BaseBoundKeyEntry

    A single key-binding entry stored on a screen layer or focus target.

    interface BaseBoundKeyEntry {
        actionId?: string;
        handler: KeyHandler;
        keys: string[];
        mode?: string;
        observer?: (remaining: number) => void;
        pressCount?: number;
        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.

    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.