我平时同时开着十来个 Claude Code 会话,等我批准的那个总藏在别的窗口后面。所以我在做一个放在桌上的小键盘:哪个会话在等我,灯告诉我;要批准的命令显示在屏幕上,按一个真键回答。 I usually have ten or so Claude Code sessions open, and the one waiting for me is always behind another window. So I'm building a desk keypad: a light tells me which session is waiting, the screen shows the exact command, and a real key answers it.
它插在 Mac 的 USB 上,不用切窗口:抬眼看灯,低头按键。It plugs into the Mac over USB, and it never needs a window switch: glance at the lights, press a key.
六个会话键下面各有一颗灯,颜色就是会话的状态。Each of the six session keys has a light under it, and its colour is that session's state.
在 App 里等你回答问题的会话,是橙色常亮。A session waiting on a question in the app glows orange without blinking.
3.5 寸触摸屏上一页一个会话:它要用什么工具、要跑什么命令,命令用等宽字体显示。The 3.5-inch touch screen shows one session per page: which tool it wants and the command it wants to run, in a monospace font.
批准和拒绝是两个机械键,有请求等着时会亮起绿灯和红灯。按下去,屏幕上那条请求就有了答案。Approve and Deny are mechanical keys that light green and red while a request is waiting. Press one, and the request on the screen has its answer.
转动选会话,桌面 App 也跟着切过去;按一下跳到下一个等你的会话;长按打断它。打断还在做Turn it to pick a session, and the desktop app switches to it too. Press it to jump to the next one waiting for you; hold it to interrupt.interrupt coming
最多 12 个会话,等你的排最前,1–6 号键永远是前六个。安静了很久的会话也在:键盘会读桌面 App 自己的会话列表。左右滑换会话,上下滑看长消息,中英文都显示。Up to twelve sessions, the ones waiting for you first; keys 1–6 are always the first six. Even quiet sessions show up, read from the desktop app's own list. Swipe sideways to change sessions, up and down for long replies; Chinese names display too.
双倍宽的说话键就是 Cadabra 的听写键,Abra 加 Cadabra,正好是一句咒语:按住说,松开字就打进当前窗口。最后一个键是回车,一条消息从说到发都不用离开键盘。The double-width Talk key is Cadabra's dictation key (Abra and Cadabra, together at last): hold it, talk, and the words land in the window I'm in. The last key is Return, so a whole message goes out without leaving the keypad.
第一阶段的样子:一个个看过会话,批准其中一个。会话是模拟的。Phase one: stepping through the sessions and approving one. The sessions are made up.
一个能批准命令的键盘,最要紧的是它什么时候不回答。坏掉的键盘绝不能变成悄悄的"同意"。A keypad that can approve commands is mostly about when it doesn't answer. A broken keypad must never turn into a silent yes.
从权限请求到按键。From a permission prompt to a key press.
都是现成的零件,加上打印的外壳和一个打印的键帽。所有尺寸都是拿尺子量的,不照规格书。Off-the-shelf parts, a printed case and one printed keycap. Every dimension came from a ruler, not a datasheet.
一步一步来,每一步先验证再往下走。从面包板到每天在用,用了六天。One step at a time, each one checked before the next. From the breadboard to daily use took six days.
hook 脚本、后台程序,还有一个终端里的假键盘,先用模拟事件测通。The hook script, the daemon, and a stand-in keypad in a terminal, tested with fake events first.
屏幕、灯、按键、旋钮一样一样接上测通。Screen, lights, keys and knob wired and tested one at a time.
打印、装配、全部手工焊好,每个键、灯和旋钮都在日志里验过。Printed, assembled and wired by hand, every key, light and the knob checked in the log.
装好 hooks,屏幕上是我真实的会话,桌面 App 跟着键盘切换。Hooks installed; the screen shows my real sessions, and the desktop app follows the keypad.
说话键接上 Cadabra,最后一个键是回车。The Talk key drives Cadabra, and the last key is Return.
长按旋钮打断一个会话。Holding the knob interrupts a session.
一路上的故事,写在我的博客里(英文)。The story so far, on my blog.
一个周末,从黑屏和不亮的灯,到回答我真实的会话:说话键接上 Cadabra,多了回车键,App 跟着键盘切换。One weekend, from a dark screen and dead lights to answering my real sessions: Talk drives Cadabra, a spare key becomes Return, and the app follows the keypad.
从完美的渲染图到桌上的实物:一个放不好的旋钮、印反的上盖、越用力越糟的键帽,和一次再没出现的卡死。From a flawless render to the thing on my desk: a knob with no home, a plate printed inside out, a keycap that got worse the harder we tried, and a freeze that never came back.
先写软件,再从一抽屉开发板里挑出 Pico,一样一样接上面包板。Software first, then a Pico picked from a drawer of boards, and a breadboard wired one part at a time.