diff options
| author | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-03-12 16:14:58 -0400 |
|---|---|---|
| committer | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-03-12 16:14:58 -0400 |
| commit | 2d9763a63a661420ae0ffa8b4436b29ed717b90b (patch) | |
| tree | 4c3623c87a6e4e184d06579569fb239cfbad3dc1 /src/client/views/GlobalKeyHandler.ts | |
| parent | ecfb0d119e08a101cd8d18e8a90d31995f71eeec (diff) | |
| parent | 641220e9cd9626af182118f84f8f775d7638cc67 (diff) | |
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
| -rw-r--r-- | src/client/views/GlobalKeyHandler.ts | 3 |
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(); |
