Skip to content

Commit

Permalink
Fix quick shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Dec 2, 2021
1 parent 5cccc38 commit 4239223
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,22 @@ const support = () => {
})
}

/**
* Register quick shortcuts
*/
const quickShortcuts = () => {
const keys = Object.keys(settings.quick_shortcuts)
const values = Object.values(settings.quick_shortcuts)

for (let i = 0; i < keys.length; i++) {
globalShortcut.register(values[i], () => {
window_application.webContents.executeJavaScript(`quickCopy("${keys[i]}")`)
})
}
}



// ? start app
app.whenReady()
.then(() => {
Expand Down Expand Up @@ -1256,18 +1272,6 @@ app.whenReady()
})
})

// ? quick shortcuts
const quickShortcuts = () => {
const keys = Object.keys(settings.quick_shortcuts)
const values = Object.values(settings.quick_shortcuts)

for (let i = 0; i < keys.length; i++) {
globalShortcut.register(values[i], () => {
window_application.webContents.executeJavaScript(`quickCopy("${keys[i]}")`)
})
}
}

window_splash = new BrowserWindow({
width: 500,
height: 550,
Expand Down

0 comments on commit 4239223

Please sign in to comment.