aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authoryipstanley <stanley_yip@brown.edu>2019-07-14 20:45:45 -0400
committeryipstanley <stanley_yip@brown.edu>2019-07-14 20:45:45 -0400
commit04b99aec4bf3b598bceb076d1981845b669fc8d0 (patch)
tree8e0c9f04c07dc1abff01f7522e4e42ee47db5adb /src/client/views/GlobalKeyHandler.ts
parent226ca7f09c22e7290a70fc850312ead90acfca12 (diff)
added key handling for ctrl left, ctrl right, and preview cursor stuff
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index d3c689571..f378b6c0c 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -107,15 +107,25 @@ export default class KeyManager {
};
});
- private ctrl = action((keyname: string) => {
+ private ctrl = action((keyname: string, e: KeyboardEvent) => {
let stopPropagation = true;
let preventDefault = true;
switch (keyname) {
case "arrowright":
+ if (document.activeElement) {
+ if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") {
+ return { stopPropagation: false, preventDefault: false };
+ }
+ }
MainView.Instance.mainFreeform && CollectionDockingView.Instance.AddRightSplit(MainView.Instance.mainFreeform, undefined);
break;
case "arrowleft":
+ if (document.activeElement) {
+ if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") {
+ return { stopPropagation: false, preventDefault: false };
+ }
+ }
MainView.Instance.mainFreeform && CollectionDockingView.Instance.CloseRightSplit(MainView.Instance.mainFreeform);
break;
case "f":