From 3b919f3235e6a9d673a89d5d2059fb43f0c4d1d2 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 2 Jan 2020 14:42:53 -0800 Subject: [PATCH] Cmd-A to select everything (#51) --- src/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 0504ff7e..3ffa138c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -381,6 +381,7 @@ class App extends React.Component<{}, AppState> { if (event.key === "Escape") { clearSelection(); drawScene(); + event.preventDefault(); } else if (event.key === "Backspace") { deleteSelectedElements(); drawScene(); @@ -402,6 +403,12 @@ class App extends React.Component<{}, AppState> { }); drawScene(); event.preventDefault(); + } else if (event.key === "a" && event.metaKey) { + elements.forEach(element => { + element.isSelected = true; + }); + drawScene(); + event.preventDefault(); } };