diff --git a/packages/editor/test/playground/map-render/js/editor.tsx b/packages/editor/test/playground/map-render/js/editor.tsx index 5a318e0c..5571beac 100644 --- a/packages/editor/test/playground/map-render/js/editor.tsx +++ b/packages/editor/test/playground/map-render/js/editor.tsx @@ -35,7 +35,7 @@ const mapId = 'welcome'; const options: EditorOptions = { zoom: 0.8, locked: false, - mapTitle: "Develop Mindnap", + mapTitle: "Develop WiseMapping", mode: 'edition-owner', locale: 'en', enableKeyboardEvents: true diff --git a/packages/editor/test/playground/map-render/js/viewmode.tsx b/packages/editor/test/playground/map-render/js/viewmode.tsx index de71046f..af21be3c 100644 --- a/packages/editor/test/playground/map-render/js/viewmode.tsx +++ b/packages/editor/test/playground/map-render/js/viewmode.tsx @@ -36,7 +36,7 @@ const persistence = new LocalStorageManager('samples/{id}.wxml', false); const options: EditorOptions = { zoom: 0.8, locked: false, - mapTitle: "Develop Mindnap", + mapTitle: "Develop WiseMapping", mode: 'viewonly', locale: 'en', enableKeyboardEvents: true diff --git a/packages/mindplot/src/components/DesignerKeyboard.ts b/packages/mindplot/src/components/DesignerKeyboard.ts index e7050f0b..caddad86 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.ts +++ b/packages/mindplot/src/components/DesignerKeyboard.ts @@ -268,29 +268,18 @@ class DesignerKeyboard extends Keyboard { event.stopPropagation(); }, ); - const excludes = ['esc', 'escape', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12']; + const excludes = ['Escape', 'F1', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12']; $(document).on('keypress', (event) => { - let keyCode: number; - if (DesignerKeyboard.isDisabled()) { return; } // Firefox doesn't skip special keys for keypress event... - if (event.key && excludes.includes(event.key.toLowerCase())) { + if (excludes.includes(event.code)) { return; } - // Sometimes Firefox doesn't contain keyCode value - if (event.key && event.keyCode === 0) { - keyCode = event.charCode; - } else { - keyCode = event.keyCode; - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const jq: any = $; - const specialKey = jq.hotkeys.specialKeys[keyCode]; - if (['enter', 'capslock'].indexOf(specialKey) === -1 && !jq.hotkeys.shiftNums[keyCode]) { + if (['Enter', 'Capslock'].indexOf(event.code) === -1) { const nodes = designer.getModel().filterSelectedTopics(); if (nodes.length > 0) { // If a modifier is press, the key selected must be ignored.