Feature Library

Keyboard shortcuts: registry, help, rebinding

<0.01 CPU ms
A still of the Keyboard shortcuts: registry, help, rebinding demo
Still
The live demo starts when it’s in view.Click a note, then ? for the help · J, K and S in the list · type over the empty note · G then I · Ctrl B while typing · rebind under Customise

One registry for every shortcut in an app.

What it costs a frame

<0.01 ms
GPU
not used
CPU, median
<0.01 ms
CPU, 95th pct
1.92 ms
Draw calls
0
Weight
Light

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured pressing a key every six frames on the note list (J, K, S and the G-then sequences, which move the selection, star notes and switch folders), and opening the help with a filter and closing it every hundred frames. Nothing runs between key presses. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed<0.011.92
apple · Apple A19 Proin a browser tab · 16 November 2026not timed<0.013.20
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed<0.012.31

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Editors and other tools people use all day
  2. G-then-letter navigation between pages
  3. Lists you move through with J and K
  4. A ? help that never goes out of date
  5. Letting users change keys that clash with their own setup
  6. Typing a name over a new, empty card, cell or row without firing letter shortcuts

Pitfalls, in brief

  1. Import shortcuts.base.css, then shortcuts.css (or your own look instead).
  2. Bind once, on window, for the whole app (the default).
  3. Some keys never reach the page: Ctrl or ⌘ with N, T, W and Tab, and ⌘Q and ⌘H on a Mac, belong to the browser or the system.
  4. Single letters (J, S, G then I) must not run while someone types.
  5. Typing over a selection with no field focused (a new card, an empty cell) is not caught by the field guard: pass typesInto, or a word typed there fires its letters’ shortcuts.
5 more in brief
  1. Single-letter shortcuts also clash with screen readers’ browse-mode letters and speech input.
  2. aria-keyshortcuts has no way to say a sequence (its spaces mean “or”), so G then I goes in the control’s visible label or title instead.
  3. Shift is ignored for symbols (?, /, [) because layouts disagree on which need it: “shift+?” and “?” are the same binding.
  4. event.key follows the user’s layout, so mod+z is the key marked Z on AZERTY too.
  5. Saved bindings are untrusted input: load() keeps only known ids and keys that parse.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

Written for the library. Fully custom code.

WAI-ARIA Authoring Practices Guide (W3C): the keyboard interface practices (assigning shortcuts, aria-keyshortcuts, not taking keys assistive technology or the browser need) and the modal dialog pattern for the help. Written here from scratch.

UI Events KeyboardEvent key and code values (W3C): the key names the registry matches on, and code as the fallback for other layouts

keyboardshortcutshotkeyskey sequencestype to editrebindinghelp overlayaria-keyshortcutsaccessibilityIMEdomno dependencies

Near it in the frame