🚧 WIP: finished shortKey page

This commit is contained in:
PiEgg
2019-09-18 19:21:13 +08:00
parent 554cc0dbf8
commit b63ac03b84
5 changed files with 77 additions and 16 deletions

View File

@@ -11,7 +11,17 @@ const shortKeyHandler = (name) => {
}
}
const shortKeyUpdater = (globalShortcut, item) => {
/**
* 用于更新快捷键绑定
* @param {globalShortcut} globalShortcut
* @param {keyObject} item
* @param {string} oldKey
*/
const shortKeyUpdater = (globalShortcut, item, oldKey) => {
// 如果提供了旧key则解绑
if (oldKey) {
globalShortcut.unregister(oldKey)
}
if (item.enable === false) {
globalShortcut.unregister(item.key)
} else {