feat: 区分左右键点击 左键自动粘贴 右键仅复制

This commit is contained in:
ZiuChen
2022-08-15 16:37:25 +08:00
parent b8e03ec5da
commit 0034019189
3 changed files with 23 additions and 4 deletions

View File

@@ -155,6 +155,14 @@ const copy = (item) => {
utools.hideMainWindow()
}
const paste = () => {
if (utools.isMacOs()) {
utools.simulateKeyboardTap('v', 'command')
} else {
utools.simulateKeyboardTap('v', 'ctrl')
}
}
const path = `${home}\\${dbName}`
const db = new DB(path)
db.init()
@@ -174,5 +182,6 @@ watchClipboard(db, (item) => {
window.db = db
window.copy = copy
window.paste = paste
window.openFile = utools.shellOpenPath
window.getIcon = utools.getFileIcon