mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-28 21:22:53 +08:00
feat: 鼠标点击历史记录后退出插件并隐藏主输入框
This commit is contained in:
parent
01d71a042e
commit
75ccc5f5f2
@ -102,7 +102,7 @@ class DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// inu1255: pbpaste & watchClipboard
|
// inu1255: pbpaste & watchClipboard
|
||||||
function pbpaste() {
|
const pbpaste = () => {
|
||||||
const files = utools.getCopyedFiles() // null | Array
|
const files = utools.getCopyedFiles() // null | Array
|
||||||
if (files) {
|
if (files) {
|
||||||
return {
|
return {
|
||||||
@ -121,7 +121,7 @@ function pbpaste() {
|
|||||||
if (text.trim()) return { type: 'text', data: text }
|
if (text.trim()) return { type: 'text', data: text }
|
||||||
}
|
}
|
||||||
|
|
||||||
function watchClipboard(db, fn) {
|
const watchClipboard = (db, fn) => {
|
||||||
let prev = db.dataBase.data[0] || {}
|
let prev = db.dataBase.data[0] || {}
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const item = pbpaste()
|
const item = pbpaste()
|
||||||
@ -137,7 +137,7 @@ function watchClipboard(db, fn) {
|
|||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
function copy(item) {
|
const copy = (item) => {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
clipboard.writeText(item.data)
|
clipboard.writeText(item.data)
|
||||||
@ -152,6 +152,7 @@ function copy(item) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
utools.outPlugin()
|
utools.outPlugin()
|
||||||
|
utools.hideMainWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = `${home}\\${dbName}`
|
const path = `${home}\\${dbName}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user