mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-31 17:49:48 +08:00
🚧 WIP: handle shortcut setting time
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
import {
|
||||
shortKeyUpdater,
|
||||
initShortKeyRegister
|
||||
} from './utils/shortKeyRegister'
|
||||
} from './utils/shortKeyHandler'
|
||||
if (process.platform === 'darwin') {
|
||||
beforeOpen()
|
||||
}
|
||||
@@ -309,9 +309,12 @@ const createSettingWindow = () => {
|
||||
settingWindow.loadURL(settingWinURL)
|
||||
|
||||
settingWindow.on('closed', () => {
|
||||
bus.emit('toggleShortKeyModifiedMode', false)
|
||||
settingWindow = null
|
||||
if (process.platform === 'linux') {
|
||||
app.quit()
|
||||
process.nextTick(() => {
|
||||
app.quit()
|
||||
})
|
||||
}
|
||||
})
|
||||
createMenu()
|
||||
@@ -506,8 +509,8 @@ ipcMain.on('getPicBeds', (evt) => {
|
||||
evt.returnValue = picBeds
|
||||
})
|
||||
|
||||
ipcMain.on('updateShortKey', (evt, val) => {
|
||||
// console.log(val)
|
||||
ipcMain.on('toggleShortKeyModifiedMode', (evt, val) => {
|
||||
bus.emit('toggleShortKeyModifiedMode', val)
|
||||
})
|
||||
|
||||
// const shortKeyHash = {
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import bus from '../utils/eventBus'
|
||||
import bus from './eventBus'
|
||||
let isInModifiedMode = false // 修改快捷键模式
|
||||
bus.on('toggleShortKeyModifiedMode', flag => {
|
||||
isInModifiedMode = flag
|
||||
})
|
||||
/**
|
||||
*
|
||||
* @param {string} name
|
||||
*/
|
||||
const shortKeyHandler = (name) => {
|
||||
if (isInModifiedMode) {
|
||||
return
|
||||
}
|
||||
if (name.includes('picgo:')) {
|
||||
bus.emit(name)
|
||||
} else if (name.includes('picgo-plugin-')) {
|
||||
Reference in New Issue
Block a user