diff --git a/src/components/key-link.tsx b/src/components/key-link.tsx
index 0a81464..f259cd9 100644
--- a/src/components/key-link.tsx
+++ b/src/components/key-link.tsx
@@ -1,5 +1,8 @@
-import { Minus, Plus } from "lucide-react";
+"use client";
+
+import { Check, Copy, Minus, Plus } from "lucide-react";
import Link from "next/link";
+import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
@@ -14,40 +17,97 @@ export function KeyLink({ entry }: { entry: DisplayedKey }) {
const isRemoved = entry.status === "removed";
return (
-
- {(isNew || isRemoved) && (
-
- {isRemoved ? (
-
- ) : (
-
- )}
-
+ {
+ // ⌘C / Ctrl+C on a focused key copies it (unless text is selected).
+ if (
+ event.key === "c" &&
+ (event.metaKey || event.ctrlKey) &&
+ !window.getSelection()?.toString()
+ ) {
+ event.preventDefault();
+ void navigator.clipboard.writeText(entry.key);
+ }
+ }}
+ >
+ {(isNew || isRemoved) && (
+
+ {isRemoved ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+
+
+
+ );
+}
+
+/**
+ * Icon button revealed on row hover. Kept out of the tab order so keys don't
+ * cost two stops each; keyboard users copy with ⌘C / Ctrl+C on the link.
+ */
+function CopyKey({ text }: { text: string }) {
+ const [copied, setCopied] = useState(false);
+
+ useEffect(() => {
+ if (!copied) return;
+ const timer = setTimeout(() => setCopied(false), 1500);
+ return () => clearTimeout(timer);
+ }, [copied]);
+
+ return (
+
);
}