mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-29 22:39:45 +08:00
feat: 支持主程序拼音、缩写检索,支持 shift+Esc 呼起主界面
This commit is contained in:
@@ -7,10 +7,12 @@ const configPath = path.join(getlocalDataFile(), './rubick-config.json');
|
||||
|
||||
let defaultConfig = {
|
||||
Darwin: {
|
||||
version: 2,
|
||||
perf: {
|
||||
shortCut: {
|
||||
showAndHidden: 'Option+R',
|
||||
separate: 'Ctrl+D'
|
||||
separate: 'Ctrl+D',
|
||||
quit: 'Shift+Escape'
|
||||
},
|
||||
common: {
|
||||
start: true,
|
||||
@@ -39,7 +41,7 @@ global.opConfig = {
|
||||
opConfig.config = JSON.parse(fs.readFileSync(configPath) || JSON.stringify(defaultConfig[platform]));
|
||||
}
|
||||
// 重置
|
||||
if (!opConfig.config.perf || !opConfig.config.superPanel || !opConfig.config.global) {
|
||||
if (!opConfig.version || opConfig.version < defaultConfig[platform].version) {
|
||||
opConfig.config = defaultConfig[platform];
|
||||
fs.writeFileSync(configPath, JSON.stringify(opConfig.config));
|
||||
}
|
||||
|
||||
@@ -63,6 +63,11 @@ class Listener {
|
||||
mainWindow.webContents.send('new-window');
|
||||
});
|
||||
|
||||
globalShortcut.register(config.perf.shortCut.quit, () => {
|
||||
mainWindow.webContents.send('init-rubick');
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
// 注册自定义全局快捷键
|
||||
config.global.forEach(sc => {
|
||||
if (!sc.key || !sc.value) return;
|
||||
|
||||
Reference in New Issue
Block a user