From 6a7430810b81ed474f976d85edb602b0c80c85fc Mon Sep 17 00:00:00 2001 From: pipipi-pikachu <1171051090@qq.com> Date: Wed, 27 Jan 2021 22:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Editor/useHotkey.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/Editor/useHotkey.ts b/src/views/Editor/useHotkey.ts index 63a93d7f..e8bdaa86 100644 --- a/src/views/Editor/useHotkey.ts +++ b/src/views/Editor/useHotkey.ts @@ -87,7 +87,8 @@ export default () => { } const keydownListener = (e: KeyboardEvent) => { - const { ctrlKey, shiftKey } = e + const { ctrlKey, shiftKey, metaKey } = e + const key = e.key.toUpperCase() if(ctrlKey && !ctrlKeyActive.value) store.commit(MutationTypes.SET_CTRL_KEY_STATE, true) @@ -101,7 +102,7 @@ export default () => { if(!editorAreaFocus.value && !thumbnailsFocus.value) return - if(ctrlKey && key === KEYS.C) { + if((ctrlKey || metaKey) && key === KEYS.C) { if(disableHotkeys.value) return e.preventDefault() copy()