diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2019-06-29 03:05:29 -0400 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-06-29 03:05:29 -0400 |
| commit | 5cfd32830586a3e1162ee81538e13d675edb79a7 (patch) | |
| tree | aeb8332fa93adaa5808afaa7a546618e705f56a3 /src/client/views/GlobalKeyHandler.ts | |
| parent | 642d22526d102198ed624a2b1e2eaed3b8f731b6 (diff) | |
keyhandler fixes and global pointer down in mainview
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
| -rw-r--r-- | src/client/views/GlobalKeyHandler.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index 95a367cea..ac1c33c71 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -4,7 +4,6 @@ import { CollectionDockingView } from "./collections/CollectionDockingView"; import { MainView } from "./MainView"; import { DragManager } from "../util/DragManager"; import { action } from "mobx"; -import { emptyFunction } from "../../Utils"; const modifiers = ["control", "meta", "shift", "alt"]; type KeyHandler = (keycode: string) => KeyControlInfo; @@ -23,6 +22,8 @@ export default class KeyManager { let isMac = navigator.platform.toLowerCase().indexOf("mac") >= 0; + // SHIFT CONTROL ALT META + this.router.set("0000", this.unmodified); this.router.set(isMac ? "0001" : "0100", this.ctrl); this.router.set(isMac ? "0100" : "0010", this.alt); @@ -59,12 +60,15 @@ export default class KeyManager { private unmodified = action((keyname: string) => { switch (keyname) { case "escape": - if (CollectionDockingView.Instance.HasFullScreen()) { - CollectionDockingView.Instance.CloseFullScreen(); + if (this.mainView.isPointerDown) { + DragManager.AbortDrag(); } else { - SelectionManager.DeselectAll(); + if (CollectionDockingView.Instance.HasFullScreen()) { + CollectionDockingView.Instance.CloseFullScreen(); + } else { + SelectionManager.DeselectAll(); + } } - DragManager.AbortDrag(); break; } |
