From 4b90086e5aabf88ab68f3c6d04f4c22ce2bcfc63 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 7 Dec 2022 21:43:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=88=AA=E5=9B=BE=E7=A9=BA=E6=A0=BC=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/app.js | 5 +++-- resources/assets/js/pages/manage/setting/keyboard.vue | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index e28592450..440e3ded7 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -169,14 +169,15 @@ $A.execMainCacheJudge = (key) => { // 绑定截图快捷键 $A.bindScreenshotKey = (data) => { let key = ""; - if (data.screenshot_key && (data.screenshot_mate || data.screenshot_shift)) { + let screenshot_key = (data.screenshot_key || "").trim().toLowerCase() + if (screenshot_key && (data.screenshot_mate || data.screenshot_shift)) { if (data.screenshot_mate) { key = /macintosh|mac os x/i.test(navigator.userAgent) ? 'command' : 'ctrl' } if (data.screenshot_shift) { key = `${key ? `${key}+` : ''}shift` } - key = `${key}+${data.screenshot_key.toLowerCase()}` + key = `${key}+${screenshot_key.toLowerCase()}` } $A.Electron.sendMessage('bindScreenshotKey', {key}); }; diff --git a/resources/assets/js/pages/manage/setting/keyboard.vue b/resources/assets/js/pages/manage/setting/keyboard.vue index f5dc9d7cb..68e96c642 100644 --- a/resources/assets/js/pages/manage/setting/keyboard.vue +++ b/resources/assets/js/pages/manage/setting/keyboard.vue @@ -74,7 +74,7 @@ export default { onKeydown({key, keyCode}) { if (keyCode !== 8) { - key = key && key.length === 1 ? key.toUpperCase() : "" + key = key && key.length === 1 ? key.trim().toUpperCase() : "" if (key) { this.formData.screenshot_key = key }