Skip to content

Commit

Permalink
Merge pull request #35 from low-earth-orbit/history
Browse files Browse the repository at this point in the history
Fix delete shortcut for macOS
  • Loading branch information
low-earth-orbit authored Sep 1, 2024
2 parents dca4a07 + b2fb95c commit bc52b3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc52b3c

Please sign in to comment.