diff --git a/src/configs/hotkey.ts b/src/configs/hotkey.ts index 2c37bfce..4e12c43d 100644 --- a/src/configs/hotkey.ts +++ b/src/configs/hotkey.ts @@ -24,6 +24,7 @@ export const enum KEYS { ESC = 'ESCAPE', PAGEUP = 'PAGEUP', PAGEDOWN = 'PAGEDOWN', + F5 = 'F5', } export const HOTKEY_DOC = [ @@ -44,7 +45,8 @@ export const HOTKEY_DOC = [ { type: '幻灯片放映', children: [ - { label: '开始放映幻灯片', value: 'Ctrl + F' }, + { label: '从头开始放映幻灯片', value: 'F5' }, + { label: '从当前开始放映幻灯片', value: 'Shift + F5' }, { label: '切换上一页', value: '↑ / ← / PgUp' }, { label: '切换下一页', value: '↓ / → / PgDown' }, { label: '切换下一页', value: 'Enter / Space' }, diff --git a/src/hooks/useGlobalHotkey.ts b/src/hooks/useGlobalHotkey.ts index bd739f2e..9a6b97ce 100644 --- a/src/hooks/useGlobalHotkey.ts +++ b/src/hooks/useGlobalHotkey.ts @@ -48,7 +48,7 @@ export default () => { const { moveElement } = useMoveElement() const { orderElement } = useOrderElement() const { redo, undo } = useHistorySnapshot() - const { enterScreening } = useScreening() + const { enterScreening, enterScreeningFromStart } = useScreening() const { scaleCanvas, resetCanvas } = useScaleCanvas() const copy = () => { @@ -134,10 +134,16 @@ export default () => { if (shiftKey && !shiftKeyState.value) keyboardStore.setShiftKeyState(true) if (!disableHotkeys.value && key === KEYS.SPACE) keyboardStore.setSpaceKeyState(true) - if (ctrlOrMetaKeyActive && key === KEYS.F) { + if (shiftKey && key === KEYS.F5) { e.preventDefault() enterScreening() - keyboardStore.setCtrlKeyState(false) + keyboardStore.setShiftKeyState(false) + return + } + if (key === KEYS.F5) { + e.preventDefault() + enterScreeningFromStart() + return } if (!editorAreaFocus.value && !thumbnailsFocus.value) return diff --git a/src/views/Editor/Canvas/index.vue b/src/views/Editor/Canvas/index.vue index 87581681..4d88ab20 100644 --- a/src/views/Editor/Canvas/index.vue +++ b/src/views/Editor/Canvas/index.vue @@ -91,7 +91,7 @@