From b2fb95cec35d9be1c4f5959c3bad557fc83347de Mon Sep 17 00:00:00 2001 From: Leo Hong <5917188+low-earth-orbit@users.noreply.github.com> Date: Sat, 31 Aug 2024 23:50:46 -0300 Subject: [PATCH] Fix delete shortcut for macOS --- components/Canvas.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/Canvas.tsx b/components/Canvas.tsx index 72bf98d..f0b1ffb 100644 --- a/components/Canvas.tsx +++ b/components/Canvas.tsx @@ -113,7 +113,10 @@ export default function Canvas() { // keyboard shortcuts useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === "Delete" || event.key === "Backspace") { + if ( + event.key === "Delete" || // Del for Windows/Linux + (event.metaKey && event.key === "Backspace") // Cmd+delete for macOS + ) { handleDelete(); } else if ( (event.ctrlKey && event.key === "z") || // Ctrl+Z for Windows/Linux