From 5cfd32830586a3e1162ee81538e13d675edb79a7 Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Sat, 29 Jun 2019 03:05:29 -0400
Subject: keyhandler fixes and global pointer down in mainview

---
 src/client/views/MainView.tsx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/client/views/MainView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 157512aa0..629827f11 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -53,9 +53,7 @@ export class MainView extends React.Component {
         let docs = DocListCast(this.mainContainer!.data);
         return (docs && docs.length > 1) ? docs[1] : undefined;
     }
-    private globalDisplayFlags = observable({
-        jumpToVisible: false
-    });
+    public isPointerDown = false;
     private set mainContainer(doc: Opt<Doc>) {
         if (doc) {
             if (!("presentationView" in doc)) {
@@ -69,10 +67,21 @@ export class MainView extends React.Component {
         KeyManager.Handler = new KeyManager(this);
         document.removeEventListener("keydown", KeyManager.Handler.handle);
         document.addEventListener("keydown", KeyManager.Handler.handle);
+
+        document.removeEventListener("pointerdown", this.pointerDown);
+        document.addEventListener("pointerdown", this.pointerDown);
+
+        document.removeEventListener("pointerup", this.pointerUp);
+        document.addEventListener("pointerup", this.pointerUp);
     }
 
+    pointerDown = (e: PointerEvent) => this.isPointerDown = true;
+    pointerUp = (e: PointerEvent) => this.isPointerDown = false;
+
     componentWillUnMount() {
         document.removeEventListener("keydown", KeyManager.Handler.handle);
+        document.removeEventListener("pointerdown", this.pointerDown);
+        document.removeEventListener("pointerup", this.pointerUp);
     }
 
     constructor(props: Readonly<{}>) {
-- 
cgit v1.2.3-70-g09d2

