diff --git a/src/configs/hotkey.ts b/src/configs/hotkey.ts index ebf14941..634b5ab1 100644 --- a/src/configs/hotkey.ts +++ b/src/configs/hotkey.ts @@ -9,6 +9,7 @@ export const enum KEYS { F = 'F', D = 'D', B = 'B', + P = 'P', MINUS = '-', EQUAL = '=', DIGIT_0 = '0', @@ -40,6 +41,8 @@ export const HOTKEY_DOC = [ { label: '恢复', value: 'Ctrl + Y' }, { label: '删除', value: 'Delete / Backspace' }, { label: '多选', value: '按住 Ctrl 或 Shift' }, + { label: '打印', value: 'Ctrl + P' }, + { label: '关闭弹窗', value: 'ESC' }, ], }, { diff --git a/src/hooks/useGlobalHotkey.ts b/src/hooks/useGlobalHotkey.ts index 9a6b97ce..e0214755 100644 --- a/src/hooks/useGlobalHotkey.ts +++ b/src/hooks/useGlobalHotkey.ts @@ -134,6 +134,12 @@ export default () => { if (shiftKey && !shiftKeyState.value) keyboardStore.setShiftKeyState(true) if (!disableHotkeys.value && key === KEYS.SPACE) keyboardStore.setSpaceKeyState(true) + + if (ctrlOrMetaKeyActive && key === KEYS.P) { + e.preventDefault() + mainStore.setDialogForExport('pdf') + return + } if (shiftKey && key === KEYS.F5) { e.preventDefault() enterScreening()