From 6a6e3ca7dac13a4ca68b1b671b337c7eb5ca53b5 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Thu, 30 Jan 2025 10:01:56 -0300 Subject: [PATCH] feat: add F12 shortcut to toggle dev tools --- src/main/services/window-manager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index f5bc8390..dc780b9c 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -248,6 +248,13 @@ export class WindowManager { WindowManager.mainWindow?.webContents.openDevTools(); + editorWindow.webContents.on("before-input-event", (event, input) => { + if (input.key === "F12") { + event.preventDefault(); + this.mainWindow?.webContents.toggleDevTools(); + } + }); + editorWindow.on("close", () => { WindowManager.mainWindow?.webContents.closeDevTools(); this.editorWindows.delete(themeId);