1// Push the Reaper root layout to the physical keypad as one atomic panel write
2// and exit (faces persist on the device). Validates the panel image protocol.
3import { Keypad } from "../src/Keypad.ts";
4import { composePanel, type Face } from "../src/KeypadUI.ts";
5import { blank, lucide, txt } from "../src/icons.ts";
6
7const keypad = await Keypad.open();
8if (!keypad.connected) {
9 console.error("Keypad not connected.");
10 process.exit(1);
11}
12
13keypad.setBrightness(0.85);
14
15// Faces in grid order: up-left, up, up-right, left, center, right, down-*.
16const faces: Face[] = [
17 lucide("AlarmClock"),
18 lucide("Clock"),
19 txt("BPM"),
20 lucide("Plus"),
21 blank,
22 blank,
23 lucide("Disc").fg("red"),
24 blank,
25 lucide("Play"),
26];
27
28keypad.setPanel(await composePanel(faces));
29console.info("Pushed the panel to the keypad — look at the device.");
30process.exit(0);