mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
快捷键补充
This commit is contained in:
parent
b5f027465c
commit
91942d4633
@ -7,6 +7,10 @@ export enum KEYS {
|
||||
G = 'G',
|
||||
L = 'L',
|
||||
F = 'F',
|
||||
D = 'D',
|
||||
MINUS = '-',
|
||||
EQUAL = '=',
|
||||
DIGIT_0 = '0',
|
||||
DELETE = 'DELETE',
|
||||
UP = 'ARROWUP',
|
||||
DOWN = 'ARROWDOWN',
|
||||
|
@ -39,9 +39,15 @@ export default () => {
|
||||
}).catch(err => message.warning(err))
|
||||
}
|
||||
|
||||
const quickCopyElement = () => {
|
||||
copyElement()
|
||||
pasteElement()
|
||||
}
|
||||
|
||||
return {
|
||||
copyElement,
|
||||
cutElement,
|
||||
pasteElement,
|
||||
quickCopyElement,
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@ import useSelectAllElement from '@/hooks/useSelectAllElement'
|
||||
import useMoveElement from '@/hooks/useMoveElement'
|
||||
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
import useScreening from '@/hooks/useScreening'
|
||||
import useScaleCanvas from '@/hooks/useScaleCanvas'
|
||||
|
||||
export default () => {
|
||||
const store = useStore()
|
||||
@ -29,16 +30,18 @@ export default () => {
|
||||
createSlide,
|
||||
deleteSlide,
|
||||
cutSlide,
|
||||
copyAndPasteSlide,
|
||||
} = useSlideHandler()
|
||||
|
||||
const { combineElements, uncombineElements } = useCombineElement()
|
||||
const { deleteElement } = useDeleteElement()
|
||||
const { lockElement } = useLockElement()
|
||||
const { copyElement, cutElement } = useCopyAndPasteElement()
|
||||
const { copyElement, cutElement, quickCopyElement } = useCopyAndPasteElement()
|
||||
const { selectAllElement } = useSelectAllElement()
|
||||
const { moveElement } = useMoveElement()
|
||||
const { redo, undo } = useHistorySnapshot()
|
||||
const { enterScreening } = useScreening()
|
||||
const { scaleCanvas, setCanvasPercentage } = useScaleCanvas()
|
||||
|
||||
const copy = () => {
|
||||
if(activeElementIdList.value.length) copyElement()
|
||||
@ -46,11 +49,15 @@ export default () => {
|
||||
}
|
||||
|
||||
const cut = () => {
|
||||
if(disableHotkeys.value) return
|
||||
if(activeElementIdList.value.length) cutElement()
|
||||
else if(thumbnailsFocus.value) cutSlide()
|
||||
}
|
||||
|
||||
const quickCopy = () => {
|
||||
if(activeElementIdList.value.length) quickCopyElement()
|
||||
else if(thumbnailsFocus.value) copyAndPasteSlide()
|
||||
}
|
||||
|
||||
const selectAll = () => {
|
||||
if(!editorAreaFocus.value) return
|
||||
selectAllElement()
|
||||
@ -111,6 +118,11 @@ export default () => {
|
||||
e.preventDefault()
|
||||
cut()
|
||||
}
|
||||
if(ctrlKey && key === KEYS.D) {
|
||||
if(disableHotkeys.value) return
|
||||
e.preventDefault()
|
||||
quickCopy()
|
||||
}
|
||||
if(ctrlKey && key === KEYS.Z) {
|
||||
if(disableHotkeys.value) return
|
||||
e.preventDefault()
|
||||
@ -171,6 +183,21 @@ export default () => {
|
||||
e.preventDefault()
|
||||
create()
|
||||
}
|
||||
if(key === KEYS.MINUS) {
|
||||
if(disableHotkeys.value) return
|
||||
e.preventDefault()
|
||||
scaleCanvas('-')
|
||||
}
|
||||
if(key === KEYS.EQUAL) {
|
||||
if(disableHotkeys.value) return
|
||||
e.preventDefault()
|
||||
scaleCanvas('+')
|
||||
}
|
||||
if(key === KEYS.DIGIT_0) {
|
||||
if(disableHotkeys.value) return
|
||||
e.preventDefault()
|
||||
setCanvasPercentage(90)
|
||||
}
|
||||
}
|
||||
|
||||
const keyupListener = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user