From 0c5f5975aa72d9a6110a1dbe59e02d63c7cb66e9 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 15 Mar 2020 21:44:26 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D1=85=D0=BE=D1=82=D0=BA=D0=B5=D1=8F=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/share/utils.js | 15 +++++++++++---- client/store/modules/reader.js | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/share/utils.js b/client/share/utils.js index a1e4d803..ed22c110 100644 --- a/client/share/utils.js +++ b/client/share/utils.js @@ -206,16 +206,23 @@ export function escapeXml(str) { export function keyEventToCode(event) { let result = []; + const modCode = event.code.substring(0, 3); if (event.metaKey) result.push('Meta'); - if (event.ctrlKey) + if (event.ctrlKey && modCode != 'Con') result.push('Ctrl'); - if (event.shiftKey) + if (event.shiftKey && modCode != 'Shi') result.push('Shift'); - if (event.altKey) + if (event.altKey && modCode != 'Alt') result.push('Alt'); - result.push(event.code); + let code = event.code; + if (modCode == 'Dig') { + code = code.substring(5, 6); + } else if (modCode == 'Key') { + code = code.substring(3, 4); + } + result.push(code); return result.join('+'); } diff --git a/client/store/modules/reader.js b/client/store/modules/reader.js index 6e5c381c..cd9fa0a8 100644 --- a/client/store/modules/reader.js +++ b/client/store/modules/reader.js @@ -30,7 +30,7 @@ const toolButtons = [ //readerActions[name] const hotKeys = [ - {name: 'help', codes: ['F1', 'KeyH']}, + {name: 'help', codes: ['F1', 'H']}, {name: 'loader', codes: ['Escape']}, ];