ink-cartridge
    Preparing search index...

    Interface KeyboardProviderProps

    Props for the keyboard provider.

    interface KeyboardProviderProps {
        autoTab?: boolean;
        children: ReactNode;
        defaultMode?: string | null;
        engine?: KeyboardEngine<ComponentType<any>>;
        modes?: string[];
        mouse?: boolean;
        mouseOptions?: MouseOptions;
        processors?: KeyboardProcessorProps<ComponentType<any>>[];
        releaseFocusWhenEmpty?: boolean;
        valueSchema?: ValueSchema;
    }
    Index
    autoTab?: boolean

    Whether the engine automatically handles Tab / Shift+Tab for focus rotation. Defaults to false.

    When true, the engine intercepts Tab/Shift+Tab and cycles focus automatically. When false or omitted, developers must call focusNext / focusPrev manually.

    children: ReactNode

    The app tree rendered inside the provider.

    defaultMode?: string | null

    The default mode must be pre-registered in the modes list.

    engine?: KeyboardEngine<ComponentType<any>>

    Pre-built engine to use instead of an internally created one. Useful for sharing an engine across providers or injecting a configured instance in tests. When omitted a fresh KeyboardEngine is created and kept alive across renders via a ref.

    modes?: string[]

    Please enter the mode flag you wish to register directly.

    <KeyboardProvider modes={["insert", "editor"]}>
    
    mouse?: boolean

    Enables terminal mouse tracking (wires xterm-mouse into the engine).

    Mouse escape sequences are filtered out of the keyboard stream automatically, so they never reach useInput handlers as garbage text. Mark any <Box> with useMouseRegion to receive click, wheel, hover, and drag callbacks.

    mouseOptions?: MouseOptions

    Options passed to the internal xterm-mouse Mouse instance when mouse is enabled. See MouseOptions (e.g. clickDistanceThreshold, pressStormThreshold, degradedDedupDistance).

    processors?: KeyboardProcessorProps<ComponentType<any>>[]

    Custom processors to inject when the engine is created.

    Each entry is positioned by index — a 0-based stage slot — or by target + position, which places it as a new stage beside the stage holding that processor id; without either it is appended after all built-in stages. A processor's own id identifies it for later re-weighting or removal.

    <KeyboardProvider
    processors={[
    { processor: { id: "uppercase", process: uppercase }, index: 0 },
    { processor: { id: "logger", process: logger }, index: 1 },
    ]}
    >
    releaseFocusWhenEmpty?: boolean

    Remove a focus target automatically once nothing binds to it any more. Off by default.

    When on, the cleanup returned by boundKeyboard, boundSequence, penetration, stop, and allowModal drops the reference it holds; the last holder to let go removes the target and focus moves to the group's first remaining target; a group whose last target goes is left without an active target until a new one registers (or focusSet / activateFocusGroup runs). Also available on the engine itself (new KeyboardEngine({ releaseFocusWhenEmpty: true })).

    valueSchema?: ValueSchema

    Optional runtime type schema for composition chain value validation.

    <KeyboardProvider valueSchema={{
    times: (v): v is number => typeof v === 'number',
    action: (v): v is number => typeof v === 'number',
    }}>