MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / onKey

Function onKey

packages/onboarding-demo/src/app.tsx:67–73  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

65
66 useEffect(() => {
67 const onKey = (event: KeyboardEvent) => {
68 if (event.key !== "[" && event.key !== "]") return;
69 const index = flowSteps.findIndex((candidate) => candidate.id === stepId);
70 const next = event.key === "]" ? index + 1 : index - 1;
71 const target = flowSteps[next];
72 if (target) goToStep(target.id);
73 };
74 globalThis.addEventListener("keydown", onKey);
75 return () => globalThis.removeEventListener("keydown", onKey);
76 }, [stepId, goToStep]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected