Design controls for a television remote
Make one visible action available on entry. Give every direction a predictable destination, keep focus visible against both light and dark scenes, and return focus to the same piece of game content after a menu closes. In Night Circuit the board has a single keyboard tab stop. Arrows move through its fifteen cells, and Enter or Space rotates the focused tile. Tab can leave the board at any time. Play Night Circuit
Write down the input contract
| Intent | Remote or keyboard equivalent | When it applies |
|---|---|---|
| Select a neighbour | Directional key | Only while a game cell owns focus. At an edge, focus stays put. |
| Act once | OK, Enter or Space | Rotate the selected tile once per deliberate press. Ignore held-key repeats for this action. |
| Pause | Pause control or Escape in the playfield | Preserve the board. Resume restores the same focused tile. The host browser may consume Escape while exiting fullscreen. |
| Leave | Link to the game guide or ordinary browser navigation | Keep an exit available from the pause controls. Leave Home and browser shortcuts to the host. |
Use labels and geometry in addition to colour. Night Circuit places a marker on the selected cell, outlines focus and marks the active power path. Its screen-reader labels describe row, column, track connections and power state. A browser receiving a keyboard event does not establish that a given television remote emits that event. Record the platform and device in your compatibility notes.
Add a gamepad as an enhancement
The Gamepad API exposes available controllers to eligible pages. A connected pad can remain invisible until a user interacts with it. An empty list also occurs when the policy or device does not allow access. Leave remote controls available throughout. Treat each entry as nullable, and use the standard button assignments only for a pad reporting the standard mapping. W3C Gamepad specification
function readStandardPad() {
try {
const pads = navigator.getGamepads?.() ?? [];
return Array.from(pads).find(pad => pad?.connected && pad.mapping === "standard");
} catch {
return undefined;
}
}
One press must produce one action. Compare the current primary button with its previous state before committing a move. For a held stick, require a dead zone and choose its dominant axis. Stop sampling when the page becomes hidden and clear held state when a controller disappears. A replacement controller should begin with a fresh press.
Lantern Lake implements these mappings in its development specimen. Night Circuit keeps its public demonstration to directional keyboard, OK-equivalent activation and touch. Neither example requires a gamepad or a second screen.
Try a focus handoff
Start Night Circuit, move to the third column, open Pause and resume. The next rotation should affect that same tile. Press Tab from the board to reach its surrounding controls, then return. These checks quickly reveal controls that accidentally capture all input. Fullscreen and resume
