Skip to content

Design: Caps Lock rules on every keyboard (with spike evidence) - #1336

Merged
malpern merged 1 commit into
masterfrom
docs/all-keyboards-caps
Oct 22, 2026
Merged

malpern merged 1 commit into
masterfrom
docs/all-keyboards-caps

Conversation

@malpern

@malpern malpern commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Proposes replacing the "choose a keyboard for Caps Lock" requirement with a per-device Caps mapping on every compatible keyboard, and records the spike that tested it on the lab mini.

Doc: docs/architecture/all-keyboards-caps.md

Why

Managed Caps tracks exactly one device (SessionCapsSelection, a one-device lease journal, automaticSelection requiring devices.count == 1). Any Mac with an external keyboard, and every multi-interface board, therefore needs a manual choice. On the lab mini (cl80, X2A, ESP32 fixture) Caps Lock rules have been paused at every session start.

Spike results (mini, master 112c0b1fc)

  • A1 ✅ Caps→F18 mapped on all three keyboards in 48 ms; each restores independently. On the fixture a 250 ms Caps hold stops toggling Caps Lock and reaches the worker as F18.
  • A3 ✅ A listen-only IOHIDManager attributes raw Caps to its device whether or not that device is mapped, without seizing it. Needs Input Monitoring (KeyPath has it).
  • A4 ✅ Merging with an existing pair on another key works and restores byte for byte. For two pairs on the same source key, the first wins.
  • A2 ⏸ Hot-plug timing not measured: needs a physical replug. A watcher is ready on the mini.
  • A stuck F18 (≈18 s) appeared during the spike under a load average of ~240; likely starvation, not ruled out.

Open questions for review

  1. Policy for a keyboard that already remaps Caps Lock (recommendation: leave it alone and report it as uncovered).
  2. Confirm multi-interface boards are fully covered.
  3. Hot-plug timing and Modifier Keys re-application on arrival.
  4. Reproduce the stuck F18 on an idle machine.

Docs only. No code changes.

Review gate: the local Scripts/review-gate.sh could not run (Claude CLI OAuth session expired on this machine, exit 1 "review did not complete"). Relying on GitHub claude-review; do not merge until it passes.

🤖 Generated with Claude Code

Proposes mapping Caps Lock on every compatible keyboard (one device-scoped
mapping each, hot-plug aware, journaled per device) instead of requiring a
chosen keyboard. Records the lab-mini spike: several keyboards mapped and
restored independently, per-device attribution without seizing, merge
behaviour with existing mappings, and the open questions (existing Caps
remaps, multi-interface boards, hot-plug timing, a stuck F18 under load).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T05:00:31.246854Z b8281f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@malpern
malpern merged commit 655ba4c into master Oct 22, 2026
4 checks passed
@malpern
malpern deleted the docs/all-keyboards-caps branch October 22, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant