Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "2026-06-05-schematic-wire-escape-cancel",
"version": "0.9.4",
"date": "2026-06-05",
"category": "fix",
"title": "Press Escape to cancel an in-progress schematic wire",
"summary": "Drawing a wire and want out? Escape now drops it — the universal EDA reflex, complementing right-click cancel and double-click finish.",
"features": ["electronics", "schematic", "ux"]
}
14 changes: 13 additions & 1 deletion packages/app/src/components/electronics/SchematicCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Supports place, wire, label, delete, and move tools.
*/

import { useRef, useCallback, useState, useMemo } from "react";
import { useRef, useCallback, useState, useMemo, useEffect } from "react";
import { useDocumentStore, getPcbNodeIds } from "@vcad/core";
import type { SchematicComponent, SchematicWire } from "@vcad/ir";
import { useElectronicsStore } from "@/stores/electronics-store";
Expand Down Expand Up @@ -261,6 +261,18 @@ export function SchematicCanvas() {

const select = useElectronicsStore((s) => s.select);
const setHoveredNet = useElectronicsStore((s) => s.setHoveredNet);

// Escape cancels an in-progress wire (the universal EDA reflex; complements
// the right-click cancel and double-click finish).
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
if (e.key === "Escape" && schTool === "wire") {
useElectronicsStore.getState().cancelSchWire();
}
};
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [schTool]);
const zoomAt = useElectronicsStore((s) => s.zoomSchAt);
const adjustPan = useElectronicsStore((s) => s.adjustSchPan);
const startSchWire = useElectronicsStore((s) => s.startSchWire);
Expand Down