feat: add F12 shortcut to toggle dev tools

This commit is contained in:
Hachi-R 2025-01-30 10:01:56 -03:00
parent 964e9bbb2b
commit 6a6e3ca7da

View File

@ -248,6 +248,13 @@ export class WindowManager {
WindowManager.mainWindow?.webContents.openDevTools(); 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", () => { editorWindow.on("close", () => {
WindowManager.mainWindow?.webContents.closeDevTools(); WindowManager.mainWindow?.webContents.closeDevTools();
this.editorWindows.delete(themeId); this.editorWindows.delete(themeId);