aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-03-10 14:00:51 -0400
committersrichman333 <sarah_n_richman@brown.edu>2024-03-10 14:00:51 -0400
commit68d017fdfb3b2592a61718de8edbdde09335cb55 (patch)
tree0bdb49127d9cf278fbb219de4216d10a1f8b1434 /src/client/views/GlobalKeyHandler.ts
parent8fc97eb6e093d4217f28919bf836425b75fdfea3 (diff)
parentcf91f5d4db5ba822b30d06cae9934bc979aff829 (diff)
Merge branch 'master' into dataviz-ai-sarah
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index 733383002..e800798ca 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -24,6 +24,7 @@ import { MainView } from './MainView';
import { DocumentLinksButton } from './nodes/DocumentLinksButton';
import { OpenWhereMod } from './nodes/DocumentView';
import { AnchorMenu } from './pdf/AnchorMenu';
+import { FormattedTextBox } from './nodes/formattedText/FormattedTextBox';
const modifiers = ['control', 'meta', 'shift', 'alt'];
type KeyHandler = (keycode: string, e: KeyboardEvent) => KeyControlInfo;
@@ -61,6 +62,8 @@ export class KeyManager {
});
public handle = action((e: KeyboardEvent) => {
+ // accumulate buffer of characters to insert in a new text note. once the note is created, it will stop keyboard events from reaching this function.
+ if (FormattedTextBox.SelectOnLoadChar) FormattedTextBox.SelectOnLoadChar = FormattedTextBox.SelectOnLoadChar + (e.key === 'Enter' ? '\n' : e.key);
e.key === 'Control' && (CtrlKey = true);
//if (!Doc.noviceMode && e.key.toLocaleLowerCase() === "shift") DocServer.UPDATE_SERVER_CACHE(true);
const keyname = e.key && e.key.toLowerCase();