diff --git a/src/enums/editPageEnum.ts b/src/enums/editPageEnum.ts index bfb51ef0..4b26802d 100644 --- a/src/enums/editPageEnum.ts +++ b/src/enums/editPageEnum.ts @@ -67,7 +67,8 @@ export enum WinKeyboard { ALT = ' alt', CTRL_SOURCE_KEY = 'control', SHIFT_SOURCE_KEY = 'shift', - ALT_SOURCE_KEY = 'alt' + ALT_SOURCE_KEY = 'alt', + SPACE = 'Space' } // Mac 键盘枚举 diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 6d56e05c..b587d854 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -273,15 +273,21 @@ export const objToCookie = (obj: RequestParamsObjType) => { * @returns */ export const setKeyboardDressShow = (keyCode?: number) => { - const code = new Map([[17, WinKeyboard.CTRL]]) + const code = new Map([ + [17, WinKeyboard.CTRL], + [32, WinKeyboard.SPACE] + ]) const dom = document.getElementById('keyboard-dress-show') if (!dom) return if (!keyCode) { + window.onKeySpacePressHold?.(false) dom.innerText = '' return } if (keyCode && code.has(keyCode)) { + window.onKeySpacePressHold?.(true) dom.innerText = `按下了「${code.get(keyCode)}」键` } } + diff --git a/src/views/chart/ContentBox/index.vue b/src/views/chart/ContentBox/index.vue index 826bbb85..8f7b5e5d 100644 --- a/src/views/chart/ContentBox/index.vue +++ b/src/views/chart/ContentBox/index.vue @@ -18,14 +18,14 @@ -
-