aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-07-10 13:01:16 -0400
committerab <abdullah_ahmed@brown.edu>2019-07-10 13:01:16 -0400
commite3f0338f8f4b223a7e4389aebeb20ede5555510b (patch)
tree3fb181c0b16161d2c8b1d7f0a7cbcd34f8e1c3c4 /src/client/views/GlobalKeyHandler.ts
parent1fb746bcb228a348da1b4d8056aab59e073ee89e (diff)
parentfd8fcfe74fff78bc67b6302f917c53e69d598712 (diff)
merged
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index e467d7c61..0d95bb96c 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -1,4 +1,4 @@
-import { UndoManager } from "../util/UndoManager";
+import { UndoManager, undoBatch } from "../util/UndoManager";
import { SelectionManager } from "../util/SelectionManager";
import { CollectionDockingView } from "./collections/CollectionDockingView";
import { MainView } from "./MainView";
@@ -13,7 +13,7 @@ type KeyControlInfo = {
};
export default class KeyManager {
- public static Handler: KeyManager = new KeyManager();
+ public static Instance: KeyManager = new KeyManager();
private router = new Map<string, KeyHandler>();
constructor() {
@@ -65,6 +65,15 @@ export default class KeyManager {
SelectionManager.DeselectAll();
}
}
+ MainView.Instance.toggleColorPicker(true);
+ break;
+ case "delete":
+ case "backspace":
+ SelectionManager.SelectedDocuments().map(docView => {
+ let doc = docView.props.Document;
+ let remove = docView.props.removeDocument;
+ remove && remove(doc);
+ });
break;
}
@@ -118,6 +127,13 @@ export default class KeyManager {
case "z":
UndoManager.Undo();
break;
+ case "a":
+ case "c":
+ case "v":
+ case "x":
+ stopPropagation = false;
+ preventDefault = false;
+ break;
}
return {