# Execution keys and readable status

The [CPU Lab](https://othmaneblial.github.io/bitborn/cpu-lab/) exposes the same
actions through buttons and optional page shortcuts. The **Enable execution
shortcuts** checkbox sits above the status message and is enabled initially to
preserve the existing controls. Turn it off with a click or Tab, then Space.
The choice stays in the current page; the app does not save a preference.

| Key | Action away from controls and editable text |
| --- | --- |
| S | Execute one modeled instruction |
| Space | Run or pause |
| R | Reset loaded bytes to their deterministic initial state; clear history |
| B | Restore the previous recorded state |
| F | Restore the next recorded state |

Turning shortcuts off changes key handling without changing the loaded program,
registers, memory, output or history. Use **Pause** to stop an active Run. Every
button remains available through Tab and Enter, including Back and Forward.
Timeline arrow/Home/End navigation is a native focused-control interaction and
remains available with execution shortcuts off.

In Safari's default Mac settings, use **Option+Tab** (and Option+Shift+Tab
backwards) to reach buttons and range controls. You can enable **Press Tab to
highlight each item on a webpage** in Safari's Advanced settings to use plain
Tab instead; see [Apple's keyboard guidance](https://support.apple.com/en-gb/guide/safari/cpsh003/mac).

Shortcuts ignore form controls, buttons, links, disclosure summaries and
contenteditable text. Repeated keydown events, text composition, events already
consumed by another control, and Ctrl/Alt/Meta combinations also do not invoke
execution commands. Editing a binary draft never invokes Step or Reset.

## Status without a message for every timer tick

The existing status region uses `role="status"` and explicit `aria-atomic="true"`.
A non-halting manual step reports its step number, executed instruction, next CS:IP and
explanation. Back/Forward report that they restore recorded state without new
execution. Run reports that it started; its timer ticks update the visible CPU
without replacing the live status for each instruction. Pause, breakpoint, halt
and errors still report the corresponding outcome. No additional live region
duplicates the register grid or every changed bit.

The switch follows the turn-off option described in
[W3C's character-key-shortcut guidance](https://www.w3.org/WAI/WCAG22/Understanding/character-key-shortcuts.html).
This is a scoped interaction change, not a whole-site conformance claim. Browser
checks inspect actual key handling, atomic status text and preserved displayed
state; live speech-input and screen-reader sessions remain separate validation.

```sh
node tests/browser_cpu_lab.mjs
npm run test:cross-browser
```

The shared browser check covers all five disabled shortcuts, native button
activation, enabled Step/Reset/Back/Forward/Run/Pause, editor/contenteditable
typing, repeat/composition/modifier/consumed events, manual-step location text,
quiet automatic ticks and final halt status.

It also traverses the page with Tab and Shift+Tab (Option in macOS WebKit) to activate Step, Back,
Forward and Reset with Enter. A focused timeline accepts ArrowLeft/ArrowRight
and Home/End without executing new instructions or losing focus; its accessible
value describes the selected recorded state. Submitting invalid binary through
the keyboard selects the bad token in the source editor and keeps the loaded
registers and history. The labeled import field has a visible focus ring, and
loading a valid raw file clears that error and resets the loaded program.
Playwright supplies the selected file; the native operating-system picker,
screen-reader speech and speech input are outside this regression's scope.
