mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-08 14:24:03 +08:00
feat: 支持通过Alt+数字键
或Ctrl+数字键
快捷复制粘贴前9条记录
This commit is contained in:
parent
7a41dcc0ed
commit
ed8185052c
@ -94,7 +94,7 @@ onMounted(() => {
|
|||||||
const isArrowDown = key === 'ArrowDown'
|
const isArrowDown = key === 'ArrowDown'
|
||||||
const isEnter = key === 'Enter'
|
const isEnter = key === 'Enter'
|
||||||
const isCopy = (ctrlKey || metaKey) && (key === 'C' || key === 'c')
|
const isCopy = (ctrlKey || metaKey) && (key === 'C' || key === 'c')
|
||||||
const isNumber = key === '1' || '2' || '3' || '4' || '5' || '6' || '7' || '8' || '9'
|
const isNumber = parseInt(key) <= 9 && parseInt(key) >= 0
|
||||||
if (isArrowUp) {
|
if (isArrowUp) {
|
||||||
if (activeIndex.value > 0) {
|
if (activeIndex.value > 0) {
|
||||||
activeIndex.value--
|
activeIndex.value--
|
||||||
@ -117,13 +117,14 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
} else if (isCopy) {
|
} else if (isCopy) {
|
||||||
if (props.fullData.data === '') {
|
if (props.fullData.data === '') {
|
||||||
|
// 如果侧栏中有数据 证明侧栏是打开的 不执行复制
|
||||||
window.copy(props.showList[activeIndex.value])
|
window.copy(props.showList[activeIndex.value])
|
||||||
}
|
}
|
||||||
} else if (isEnter) {
|
} else if (isEnter) {
|
||||||
window.copy(props.showList[activeIndex.value])
|
window.copy(props.showList[activeIndex.value])
|
||||||
window.paste()
|
window.paste()
|
||||||
} else if (altKey && isNumber) {
|
} else if ((ctrlKey || metaKey || altKey) && isNumber) {
|
||||||
window.copy(props.showList[parseInt(key)])
|
window.copy(props.showList[parseInt(key) - 1])
|
||||||
window.paste()
|
window.paste()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -126,9 +126,7 @@ onMounted(() => {
|
|||||||
const { key, ctrlKey, metaKey } = e
|
const { key, ctrlKey, metaKey } = e
|
||||||
const isTab = key === 'Tab'
|
const isTab = key === 'Tab'
|
||||||
const isSearch =
|
const isSearch =
|
||||||
key === '/' ||
|
(ctrlKey && (key === 'F' || key === 'f')) || (ctrlKey && (key === 'L' || key === 'l'))
|
||||||
(ctrlKey && (key === 'F' || key === 'f')) ||
|
|
||||||
(ctrlKey && (key === 'L' || key === 'l'))
|
|
||||||
const isExit = key === 'Escape'
|
const isExit = key === 'Escape'
|
||||||
if (isTab) {
|
if (isTab) {
|
||||||
const list = ['all', 'text', 'image', 'file']
|
const list = ['all', 'text', 'image', 'file']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user