onKeyDown function ✓ 100.0%

Last updated: 2026-03-05T11:49:57.418Z

Metrics

LOC: 11 Complexity: 5 Params: 1 Coverage: 100.0% (1/1 lines, 0x executed)

Signature

onKeyDown(e: KeyboardEvent): : void

Source Code

function onKeyDown(e: KeyboardEvent): void {
  if (!session || session.status !== "recording") return;

  // Only capture meaningful keys (Enter, Escape, Tab)
  const capturedKeys = ["Enter", "Escape", "Tab"];
  if (!capturedKeys.includes(e.key)) return;

  const el = e.target as Element;
  if (isExtensionUI(el)) return;
  addStep(buildStep("press-key", el, { key: e.key }));
}

Dependencies (Outgoing)

graph LR onKeyDown["onKeyDown"] isExtensionUI["isExtensionUI"] addStep["addStep"] buildStep["buildStep"] onKeyDown -->|calls| isExtensionUI onKeyDown -->|calls| addStep onKeyDown -->|calls| buildStep style onKeyDown fill:#dbeafe,stroke:#2563eb,stroke-width:2px click onKeyDown "73ba995fd6e6330e.html" click isExtensionUI "d32bf4175ca1ff44.html" click addStep "012da91201f9487b.html" click buildStep "6d1088fe63d8f4bc.html"
TargetType
isExtensionUI calls
addStep calls
buildStep calls

No incoming dependencies.