From 39a47659b62f167b8a82a003abf7fd0ce52be479 Mon Sep 17 00:00:00 2001 From: Siklos Date: Thu, 18 Aug 2022 14:23:56 +0200 Subject: [PATCH] Add option to disable shortcuts --- src/Components/Editor/Shortcuts.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Components/Editor/Shortcuts.ts b/src/Components/Editor/Shortcuts.ts index aa20d96..f7d7b5b 100644 --- a/src/Components/Editor/Shortcuts.ts +++ b/src/Components/Editor/Shortcuts.ts @@ -1,5 +1,6 @@ import { Dispatch, SetStateAction } from 'react'; import { IHistoryState } from '../../Interfaces/IHistoryState'; +import { ENABLE_SHORTCUTS } from '../../utils/default'; export function onKeyDown( event: KeyboardEvent, @@ -7,6 +8,10 @@ export function onKeyDown( historyCurrentStep: number, setHistoryCurrentStep: Dispatch> ): void { + if (!ENABLE_SHORTCUTS) { + return; + } + event.preventDefault(); if (event.isComposing || event.keyCode === 229) { return;