Skip to content

Core concepts ​

A one-page map: ink-cartridge has three parts — the screen system, the keyboard engine, and the React adapter. Building this overall picture first makes the later chapters much easier.

Prerequisites ​

ChapterWhy you need it
Quick StartGet it running first, then read the structure

The three parts ​

PartResponsibilityEntry point
Screen systemScreen tree and stack, layers, modal layers, navigationregisterComponent / useScreenSystem
Keyboard engineThe whole path from a key press to a matched binding (nine-stage pipeline)KeyboardEngine
React adapterWires both into ReactScenarioManagementProvider / KeyboardProvider

Screen tree and stack ​

registerComponent(Component, template, { parent }) builds a screen tree; the active one is a stack from root to leaf, whose top is the screen CurrentScreen renders. skip / back / gotoScreen navigate within it. See Organize Your Screen and Navigation.

Layers and modal layers ​

Layers float above the screen; modal layers float above the layers and, by default, take over the keyboard exclusively. Both are opened / closed through useScreenSystem. See Layer Basics and Modal Layer Basics.

The keyboard pipeline ​

A key press travels from the device to a matched binding through a nine-stage pipeline:

Modal → overlay phase (composition / global sequences / global keys) → layer broadcast → screen phase (composition / global sequences / global keys) → screen stack

The first stage that consumes the event ends propagation. See Custom Processors.

Ownership ​

Every binding carries an owner (the current screen or layer element); a key is matched only while that owner is active. See Binding Attribution & the Owner Stack.

Provider nesting ​

KeyboardProvider must sit inside ScenarioManagementProvider. Reversed, the keyboard silently stops working.

Released under the MIT License.