From 73cef1512c1361079e6146e5f417c9351007b072 Mon Sep 17 00:00:00 2001 From: Ther Date: Sat, 24 May 2025 19:42:18 +0800 Subject: [PATCH] fix #437 --- src/main/common/registerHotKey.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/common/registerHotKey.ts b/src/main/common/registerHotKey.ts index 782787f..0d76b40 100644 --- a/src/main/common/registerHotKey.ts +++ b/src/main/common/registerHotKey.ts @@ -93,6 +93,12 @@ const registerHotKey = (mainWindow: BrowserWindow): void => { // mainWindow.show(); }); + globalShortcut.register('CommandOrControl+W', () => { + if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isFocused()) { + mainWindow.hide(); + } + }); + // 注册自定义全局快捷键 config.global.forEach((sc) => { if (!sc.key || !sc.value) return;