diff options
author | bobzel <zzzman@gmail.com> | 2024-03-10 09:48:15 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-03-10 09:48:15 -0400 |
commit | 36d18da80e5e5e1c6cae0dc21c1677a7ab9c1d77 (patch) | |
tree | 69dae37de1312ff8704e661a8e9dda98da30346a /src/client/views/GlobalKeyHandler.ts | |
parent | 2279f029ce19c9f7f886a6966ea5f23be9468890 (diff) | |
parent | a9eb266296d1b71f1016c867f39e20299c011eea (diff) |
Merge branch 'master' into eleanor-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(); |