Skip to content

Commit

Permalink
Merge branch 'MaLuns-patch-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
pipipi-pikachu committed Feb 6, 2025
2 parents 9fde752 + 9e3031d commit 95c8692
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/hooks/useGlobalHotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,23 @@ export default () => {
mainStore.setSearchPanelState(!showSearchPanel.value)
return
}
if (ctrlKey && key === KEYS.MINUS) {
e.preventDefault()
scaleCanvas('-')
return
}
if (ctrlKey && key === KEYS.EQUAL) {
e.preventDefault()
scaleCanvas('+')
return
}
if (ctrlKey && key === KEYS.DIGIT_0) {
e.preventDefault()
resetCanvas()
return
}

if (!editorAreaFocus.value && !thumbnailsFocus.value) return
if (!editorAreaFocus.value && !thumbnailsFocus.value) return

if (ctrlOrMetaKeyActive && key === KEYS.C) {
if (disableHotkeys.value) return
Expand Down Expand Up @@ -255,21 +270,6 @@ 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()
resetCanvas()
}
if (key === KEYS.TAB) {
if (disableHotkeys.value) return
e.preventDefault()
Expand Down Expand Up @@ -317,4 +317,4 @@ export default () => {
document.removeEventListener('keyup', keyupListener)
window.removeEventListener('blur', keyupListener)
})
}
}

0 comments on commit 95c8692

Please sign in to comment.