mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-28 03:59:31 +08:00
Compare commits
3 Commits
6315ec12ae
...
a546bc0d59
Author | SHA1 | Date | |
---|---|---|---|
|
a546bc0d59 | ||
|
c732e448c3 | ||
|
fbc7da0606 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "4.3.4",
|
||||
"version": "4.3.5",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -110,10 +110,15 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
|
||||
// mainWindow.show();
|
||||
});
|
||||
|
||||
globalShortcut.register('CommandOrControl+W', () => {
|
||||
if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isFocused()) {
|
||||
// 添加局部快捷键监听
|
||||
mainWindow.webContents.on('before-input-event', (event, input) => {
|
||||
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