In development. It changes without notice.
Topic
First-Time Setup
The first use of a board: its keys, the language, a rehearsal of each control, the unlock secret, and the pairing of a first computer.
It has one handler for the boards with keys or touch and one for the boards with a keyboard. Its pairing page and the settings' page that adds a host are the two that open the pairing window (BLE HID Keyboard).
Files | |
| file | src/ |
| FSM handler for first-time setup on the keyboard boards (the M5Cardputer ADV and the LILYGO T-Deck). | |
| file | src/ |
| The drawing both first-time setup flows share: the setup header with its progress bar, the welcome mark and the touch-gesture row. | |
| file | src/ |
| Where the dial board's setup pages put their rows and key locators. | |
| file | src/ |
| Which onboarding pages a board plays, and in what order. | |
| file | src/ |
| Headless finite-state machine driving the first-time setup flow. | |
| file | src/ |
| FSM handler for first-time setup on the boards without a keyboard. | |
| file | src/ |
The constants and helpers the sources of OnboardingStateHandler share. | |
| file | src/ |
| The chrome the five first-run tutorials share and the sequencing that enters each (part of onboarding_ | |
| file | src/ |
| The first-run Timing Arc tutorial: a practice dial for the PIN's hold-and-release (part of onboarding_ | |
| file | src/ |
| The first-run dropdown tutorial: a picker of five sample options, one committed (part of onboarding_ | |
| file | src/ |
| The first-run stepper tutorial: a bounded practice value stepped away from its start (part of onboarding_ | |
| file | src/ |
| The first-run tabs tutorial: the vault's tab strip, walked until every tab was shown (part of onboarding_ | |
| file | src/ |
| The first-run writing tutorial: two glyphs typed on the CharWheel, the button boards' text editor (part of onboarding_ | |
| file | src/ |
| The one-line messages of a setup page: the role each fits the panel in, and the tips a touch board's closing page shows. | |
| file | src/ |
| Headless sequencer for the interactive component tutorials block. | |
Classes | |
| class | kleidos:: |
| First-time setup on the keyboard boards: language, passphrase, clock and pairing, after the keys (and touch) tour. More about kleidos:: | |
| struct | kleidos:: |
| The header's Skip button where the board draws its own touch controls: the drawn button at the header's free right end, and the header band around it that answers the tap. Both empty elsewhere. One geometry for the draw and the pointer. More about kleidos:: | |
| struct | kleidos:: |
| Where one row of the controls page sits. More about kleidos:: | |
| struct | kleidos:: |
| The controls page's row ladder. More about kleidos:: | |
| struct | kleidos:: |
| An arrow that points at a chassis key. More about kleidos:: | |
| struct | kleidos:: |
| The pages one flow plays, in order. More about kleidos:: | |
| class | kleidos:: |
| Headless onboarding router; holds the captured PIN and current step only. More about kleidos:: | |
| class | kleidos:: |
First-time setup on the boards without a keyboard: runs the OnboardingLogic steps and its introduction screens, and stores the finished flag and the language. More about kleidos:: | |
| class | kleidos:: |
| Headless tutorial sequencer; holds the phase, goal flag, and the completed bitmask only. More about kleidos:: | |
Functions | |
| SkipRects | kleidos:: |
| Where the header's Skip button goes on this board. | |
| int16_t | kleidos:: |
| Y of the first content line (a middle-center datum) below the setup header and its progress bar. | |
| void | kleidos:: |
| Draw the "Kleidos · setup" header and the step progress bar under it. | |
| void | kleidos:: |
| Draw a short panel's setup header: the page title in the header bar itself (no "setup" subtitle, no separate title line) and the progress bar under it, so the page keeps its rows. | |
| int16_t | kleidos:: |
| Bottom of the compact setup header's progress bar. | |
| void | kleidos:: |
Draw the big Kleidos welcome mark (lock and keyhole) centered at (cx, cy), edge pixels across. | |
| int16_t | kleidos:: |
Draw the three touch gestures side by side under titleY: tap to select, swipe to scroll, swipe sideways to change tab — each an icon, the gesture in bold and what it does. | |
| constexpr EpaperControlLayout | kleidos:: |
Lay the controls page's five rows between top and bottom. | |
| constexpr EpaperLocator | kleidos:: |
Where to point for mark on a w by h panel. | |
| constexpr Flow | kleidos:: |
The flow a board with profile plays. | |
| constexpr const PageList & | kleidos:: |
The pages flow plays, in order. | |
| constexpr bool | kleidos:: |
Whether flow plays page at all. | |
| constexpr bool | kleidos:: |
Whether page holds the Bluetooth radio while it is on screen. | |
| constexpr bool | kleidos:: |
| Whether a page change has to stop the radio. | |
| constexpr Page | kleidos:: |
The page after page in flow, wrapping from the last to the first. | |
| constexpr TutorialPhase | kleidos:: |
The tutorial page rehearses. | |
| constexpr uint8_t | kleidos:: |
The tutorials flow plays, as a tutorialBit mask. | |
| constexpr OnboardingStep | kleidos:: |
The canonical step page belongs to. | |
| uint8_t | kleidos:: |
The 1-based bar step a canonical step shows in a button or touch flow. | |
| uint8_t | kleidos:: |
The 1-based step page shows in flow's progress bar. | |
| constexpr uint8_t | kleidos:: |
The denominator of flow's progress bar. | |
| ui:: | kleidos:: |
| void | kleidos:: |
| bool | kleidos:: |
| const char * | kleidos:: |
| ui::Rect | kleidos:: |
| Goal-pill band above the action bar, shared by all five tutorial screens. | |
| void | kleidos:: |
| void | kleidos:: |
| int16_t | kleidos:: |
| Y of the single hint line drawn under a tutorial title. | |
| uint8_t | kleidos:: |
| Number of cells the tutorial strip draws. | |
| ui:: | kleidos:: |
| int16_t | kleidos:: |
| Width a one-line message of a setup page may take. | |
| hal:: | kleidos:: |
| The role a one-line message is drawn in. | |
| hal:: | kleidos:: |
| The one role the tips of a page are drawn in. | |
| int16_t | kleidos:: |
| Width a gesture's line may take in its third of the panel. | |
| hal:: | kleidos:: |
| The one role the three gesture uses are drawn in. | |
| constexpr uint8_t | kleidos:: |
The mask bit that stands for phase. | |
Variables | |
| constexpr int16_t | kleidos:: |
| Gap (px) between the bottom of the setup header and the progress bar. | |
| constexpr size_t | kleidos:: |
| Rows the controls page draws: move, press, hold, back, lock. | |
| constexpr int16_t | kleidos:: |
| Width of the mark column, wide enough for a bold "OK" and a key-cap chip. | |
| constexpr int16_t | kleidos:: |
| Gap between the mark column and the words. | |
| constexpr size_t | kleidos:: |
| Number of flows; not a flow. | |
| constexpr size_t | kleidos:: |
| Number of pages in the catalog; not a page. | |
| constexpr std::array< PageList, kFlowCount > | kleidos:: |
| Every flow's page order, indexed by Flow. | |
| constexpr uint8_t | kleidos:: |
| How many steps the dial's progress bar counts (see progressStep). | |
| constexpr uint32_t | kleidos:: |
| constexpr uint32_t | kleidos:: |
| constexpr uint32_t | kleidos:: |
| Caret blink half-cycle on the WRITING screen (motion.pulse). | |
| constexpr int32_t | kleidos:: |
| constexpr std::array< i18n:: | kleidos:: |
| constexpr std::array< i18n:: | kleidos:: |
| constexpr uint8_t | kleidos:: |
Number of playable tutorial phases (excludes the terminal COMPLETE). | |
| constexpr uint8_t | kleidos:: |
| Every playable tutorial: the mask a two-button board resets with. | |
Enumeration Type Documentation
EpaperKeyMark #
Flow #
Which set of pages a board plays, chosen by what it can be driven with.
OnboardingResult #
Outcome codes returned by each step-transition call in OnboardingLogic.
OnboardingStep #
Steps of the canonical onboarding flow.
| Value | UI screen | Advance function |
|---|---|---|
WELCOME | Brand splash | advanceFromWelcome |
LANGUAGE | Language picker | advanceFromLanguage |
TUTORIAL | Interactive tutorials × 5 | advanceFromTutorial |
CreatePin | First PIN entry | storeCreatedPin |
ConfirmPin | Second PIN entry | confirmPin |
PAIR | Optional BLE pairing | advanceFromPair |
DEMO | Optional fake-credential | advanceFromDemo |
DONE | "Open vault" CTA | acknowledgeDone |
| Enumerator | |
|---|---|
| WELCOME | Intro screen. |
| LANGUAGE | Language selection. |
| TUTORIAL | Interactive component tutorials (OnboardingTutorialLogic). |
| CreatePin | First PIN entry. |
| ConfirmPin | Confirm PIN entry. |
| PAIR | Optional BLE pairing. |
| DEMO | Optional demo screen. |
| DONE | Setup complete. |
Page #
One page of setup. The names and order are the whole catalog; a flow's table picks from it.
TutorialPhase #
Phases of the interactive component-tutorial block, in play order.
| Value | Component exercised | Goal |
|---|---|---|
ARC | ui:: timing-arc dial | lock one digit |
TABS | ui:: icon pager | visit every tab |
DROPDOWN | ui:: single-select list | commit a pick |
STEPPER | ui:: numeric editor | change the value |
WRITING | ui:: text entry | type two glyphs |
COMPLETE | (terminal — leave the block) | — |
Function Documentation
barStep() #
The 1-based bar step a canonical step shows in a button or touch flow.
The flow without a clock chip plays one page more — the clock, right after the PIN — so every step after the PIN moves one along its bar.
- Parameters
-
Name Direction Meaning flow in The board's flow (not the dial's, which numbers pages). step in A canonical step.
- Returns
- Its position in
flow'sbar.
compactHeaderBottom() #
Bottom of the compact setup header's progress bar.
- Parameters
-
Name Direction Meaning layout in Responsive context.
- Returns
- The y just under the bar.
contentTopY() #
Y of the first content line (a middle-center datum) below the setup header and its progress bar.
- Parameters
-
Name Direction Meaning layout in Responsive context.
- Returns
- The line's center.
drawCompactSetupHeader() #
Draw a short panel's setup header: the page title in the header bar itself (no "setup" subtitle, no separate title line) and the progress bar under it, so the page keeps its rows.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context. title in The page title. step in 1-based step. total in Steps in the flow.
drawOnbActionBar() #
Draw a setup page's footer hint bar. The affordance-driven component maps the semantic slots to the board's physical inputs (A/B key caps on the Stick, key hints on keyboards, dial icons on CoreInk); a null secondary draws a single centered slot. Defined in onboarding_
- Parameters
-
Name Meaning canvas The canvas to draw on. layout The active display layout. primary The primary slot's label. secondary The secondary slot's label, or null for one slot. tertiary The tertiary slot's label, or null for none. secondaryHeld Whether the secondary acts on a hold (skip on two buttons), which draws the rule that announces it. primaryHold The primary slot's hold label, or null for none.
drawSetupHeader() #
Draw the "Kleidos · setup" header and the step progress bar under it.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context. step in 1-based step; 0 draws nothing (a splash owns the screen). total in Steps in the flow (the bar's full length). skip in Draw the Skip button, on the boards that draw their own touch controls, for a page that can be skipped.
drawTouchGestures() #
Draw the three touch gestures side by side under titleY: tap to select, swipe to scroll, swipe sideways to change tab — each an icon, the gesture in bold and what it does.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context. titleY in Center of the page title the row sits under.
- Returns
- The y just below the row.
drawTutGoalPill() #
Draw the tutorial goal pill: the goal caption while pending, the shared "nice!" copy once the goal is reached. Clears the band first so it can be repainted in place when the goal flips. Defined in onboarding_
- Parameters
-
Name Meaning canvas The canvas to draw on. layout The active display layout. goal The goal caption. done Whether the goal is reached.
Draw the tutorial goal pill: the goal caption while pending, the shared "nice!" copy once the goal is reached. Clears the band first so it can be repainted in place when the goal flips.
drawTutTitle() #
Draw the tutorial title line: centered heading + a right-aligned "x/y" block counter so the section reads as one guided block. Defined in onboarding_
- Parameters
-
Name Meaning canvas The canvas to draw on. layout The active display layout. title The tutorial's title. number The tutorial's position in the block, from 1. count The number of tutorials in the block.
Draw the tutorial title line: centered heading + a right-aligned "x/y" block counter so the section reads as one guided block.
drawWelcomeMark() #
Draw the big Kleidos welcome mark (lock and keyhole) centered at (cx, cy), edge pixels across.
Color boards blit the anti-aliased asset at native size; boards without it draw the primitive key mark.
- Parameters
-
Name Direction Meaning canvas in, out Drawing surface. layout in Responsive context. cx in Center x. cy in Center y. edge in Mark size in pixels.
epaperControlRows() #
Lay the controls page's five rows between top and bottom.
The rows share one pitch and are centered in the band, so the ladder reads as one block rather than as text that happens to be stacked. A band too short for five rows of rowH reports fits false instead of overlapping them: the page would rather be caught by a test than crush its own lines.
- Parameters
-
Name Direction Meaning left in Left edge of the page's content. top in First pixel the rows may use. bottom in First pixel they may not (the action bar's top). rowH in Height of one row's text.
- Returns
- The ladder.
epaperKeyLocator() #
Where to point for mark on a w by h panel.
- Warning
- The key positions are read from the CoreInk's documented button table, not measured against a unit. They are close enough to read as "this edge, about here" and are worth re-checking on glass.
- Parameters
-
Name Direction Meaning mark in Which key. w in Panel width. h in Panel height.
- Returns
- Where its arrow goes.
flowFor() #
The flow a board with profile plays.
- Parameters
-
Name Direction Meaning profile in The board's UI profile. hasClock in Whether the board has a clock chip that keeps the time while it is off.
- Returns
- Its flow.
gestureColumnRoom() #
Width a gesture's line may take in its third of the panel.
- Parameters
-
Name Direction Meaning layout in Responsive context.
- Returns
- A third of the panel's width less a small gap, so two neighboring lines never touch and the last never meets the glass's edge.
gestureUseFont() #
The one role the three gesture uses are drawn in.
- Parameters
-
Name Direction Meaning canvas in Surface used only to measure text. layout in Responsive context.
- Returns
- Body where every use fits gestureColumnRoom in the current language, small as soon as one would not ("cambiar pestaña" is wider than a third of a Core board at body size).
includesPage() #
Whether flow plays page at all.
- Parameters
-
Name Direction Meaning flow in The board's flow. page in The page in question.
- Returns
- Whether it is in that flow's order.
lineFont() #
The role a one-line message is drawn in.
- Parameters
-
Name Direction Meaning canvas in Surface used only to measure text. layout in Responsive context. text in The line.
- Returns
- Body where
textfits lineRoom, small where it would not.
lineRoom() #
Width a one-line message of a setup page may take.
- Parameters
-
Name Direction Meaning layout in Responsive context.
- Returns
- The panel's width less a medium gap on each side.
nextPage() #
The page after page in flow, wrapping from the last to the first.
Wrapping is what the skip command needs: skipping past the end returns to the welcome page rather than leaving setup.
- Parameters
-
Name Direction Meaning flow in The board's flow. page in The page on screen; one outside the flow gives its first.
- Returns
- The next page.
onbLayout() #
Build the per-screen responsive context once (insets / fonts / spacing scaled to the active board) so every component lays itself out correctly across every board without reading display::
- Returns
- The layout context of the active display.
pageOwnsRadio() #
Whether page holds the Bluetooth radio while it is on screen.
Only the pairing page brings the radio up, so only the pairing page owns it. The page that owns it stops it when it is left, which is what keeps the pairing window and any link it admitted inside setup.
- Parameters
-
Name Direction Meaning page in A page of the catalog.
- Returns
- Whether it owns the radio.
pagesFor() #
The pages flow plays, in order.
- Parameters
-
Name Direction Meaning flow in The board's flow.
- Returns
- Its page list (the Buttons list for a value outside the table).
progressStep() #
The 1-based step page shows in flow's progress bar.
The button and touch flows number the eight canonical steps. The dial's flow is shorter than the catalog, so it numbers only the pages that carry a bar — a "3 of 8" on a board that never plays pages 6 and 7 would be a lie about how much is left.
- Parameters
-
Name Direction Meaning flow in The board's flow. page in The page on screen.
- Returns
- Its step, or 0 for a page that carries no bar.
progressSteps() #
The denominator of flow's progress bar.
- Parameters
-
Name Direction Meaning flow in The board's flow.
- Returns
- How many steps it counts.
skipKeyPressed() #
The skip key of a setup page: the dedicated back key where the board has one (and only it: OK never skips there), a B hold on two buttons (a B tap moves, as in every list), a B tap on the boards with a C.
The skip key of a setup page: the dedicated back key where the board has one (and only it: OK never skips there), a B hold on two buttons (a B tap moves, as in every list), a B tap on the boards with a C. Defined in onboarding_
- Parameters
-
Name Meaning ctx The application context whose inputs are read.
- Returns
- Whether the skip key was pressed this tick.
skipRects() #
Where the header's Skip button goes on this board.
- Parameters
-
Name Direction Meaning layout in Responsive context.
- Returns
- The button and its hit box; both empty unless the board draws its own touch controls.
stepOf() #
The canonical step page belongs to.
- Parameters
-
Name Direction Meaning page in A page of the catalog.
- Returns
- Its step, one of the eight the progress bar counts.
stopRadioOnPageChange() #
Whether a page change has to stop the radio.
- Parameters
-
Name Direction Meaning leavingOwns in Whether the page being left owns the radio. enteringOwns in Whether the page being entered owns it.
- Returns
- Whether the radio must be stopped as part of the change.
tipsFont() #
The one role the tips of a page are drawn in.
- Parameters
-
Name Direction Meaning canvas in Surface used only to measure text. layout in Responsive context. tips in The page's tips, one line each.
- Returns
- Body where every tip fits lineRoom in the current language, small as soon as one of them would not.
tutHint() #
A tutorial's hint: the glass words where the board draws its own touch controls, the three-button words where there is a C, else the two-button words. Defined in onboarding_
- Parameters
-
Name Meaning buttons The two-button words. threeButtons The three-button words. touch The glass words. hasC Whether the board has a C key.
- Returns
- The translated hint.
A tutorial's hint: the glass words where the board draws its own touch controls, the three-button words where there is a C, else the two-button words.
tutHintBand() #
Goal-pill band above the action bar, shared by all five tutorial screens.
Goal-pill band above the action bar, shared by all five tutorial screens. Defined in onboarding_
- Parameters
-
Name Meaning layout The active display layout.
- Returns
- The band the goal pill is drawn in.
tutHintLineY() #
Y of the single hint line drawn under a tutorial title.
Y of the single hint line drawn under a tutorial title. Defined in onboarding_
- Parameters
-
Name Meaning canvas The canvas whose fonts are measured. layout The active display layout.
- Returns
- The hint line's center Y.
tutorialBit() #
The mask bit that stands for phase.
- Parameters
-
Name Direction Meaning phase in A playable phase; COMPLETEhas no bit.
- Returns
- Its bit, or 0 for
COMPLETE.
tutorialMask() #
The tutorials flow plays, as a tutorialBit mask.
Derived from the flow's own page table, so the sequencer can never play a tutorial the flow has no page for.
- Parameters
-
Name Direction Meaning flow in The board's flow.
- Returns
- The mask to reset OnboardingTutorialLogic with.
tutorialOf() #
The tutorial page rehearses.
- Parameters
-
Name Direction Meaning page in A page of the catalog.
- Returns
- Its tutorial, or
TutorialPhase::for a page that rehearses nothing.COMPLETE
tutTabCount() #
Number of cells the tutorial strip draws.
Number of cells the tabs tutorial's strip draws. Defined in onboarding_
- Returns
- The strip's cell count.
tutWritingBarFor() #
The writing tutorial's action bar for this board: the editor's own verbs on the dial, the button bindings elsewhere. Defined in onboarding_
- Parameters
-
Name Meaning mode The CharWheel's region (group selector or body). holdPctB How far the B hold has charged, filling its rule. twoButtons Whether the board has two buttons (no C).
- Returns
- The bar's props.
Variable Documentation
kTouchClosingTips #
The tips the closing page shows on a board that draws its own touch controls, top to bottom: the tap grammar, the swipe, the lock.
kTouchGestureUses #
What each of the three gestures of the touch introduction does, left to right under its verb: tap to choose, swipe up or down to scroll, swipe sideways to change tab.
kTutBackHoldMs #
BtnB hold threshold for "skip this tutorial" on the commit-driven screens (dropdown / stepper) of the three-button boards: every hold is one length.
kTutBeatMs #
Pause after an auto-completed goal (arc lock / all tabs visited) before the flow advances, so the success pill is seen.
kTutStepStart #
The value the stepper tutorial starts at, inside its practice range of 0 to 10 s; stepping away from it is the goal.