mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-27 11:39:31 +08:00
fix #448
This commit is contained in:
parent
6315ec12ae
commit
fbc7da0606
@ -110,9 +110,14 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
|
|||||||
// mainWindow.show();
|
// mainWindow.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
globalShortcut.register('CommandOrControl+W', () => {
|
// 添加局部快捷键监听
|
||||||
if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isFocused()) {
|
mainWindow.webContents.on('before-input-event', (event, input) => {
|
||||||
mainWindow.hide();
|
if (input.key.toLowerCase() === 'w'
|
||||||
|
&& (input.control || input.meta) && !input.alt && !input.shift) {
|
||||||
|
event.preventDefault();
|
||||||
|
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||||
|
mainWindow.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user