mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-03 14:50:57 +08:00
🚧 WIP: shortcut setting page
This commit is contained in:
@@ -11,6 +11,16 @@ const shortKeyHandler = (name) => {
|
||||
}
|
||||
}
|
||||
|
||||
const shortKeyUpdater = (globalShortcut, item) => {
|
||||
if (item.enable === false) {
|
||||
globalShortcut.unregister(item.key)
|
||||
} else {
|
||||
globalShortcut.register(item.key, () => {
|
||||
shortKeyHandler(item.name)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化阶段的注册
|
||||
const initShortKeyRegister = (globalShortcut, shortKeys) => {
|
||||
let errorList = []
|
||||
@@ -28,5 +38,6 @@ const initShortKeyRegister = (globalShortcut, shortKeys) => {
|
||||
}
|
||||
|
||||
export {
|
||||
shortKeyUpdater,
|
||||
initShortKeyRegister
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user