Skip to content

Commit

Permalink
fix: add a keyboard shortcut for devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravjeetsingh committed Jul 18, 2024
1 parent 34968c0 commit 1c199a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ i18n.init({

expressApp.use(express.static(path.join(__dirname, 'www', 'obs')));

const { app, webContents, BrowserWindow, dialog, ipcMain, safeStorage } = electron;
const { app, webContents, BrowserWindow, dialog, ipcMain, safeStorage, globalShortcut } = electron;

const store = new Store({
configName: 'user-preferences',
Expand Down Expand Up @@ -300,7 +300,7 @@ function checkForExternalDisplay() {
viewerWindowPos.y = externalDisplay.bounds.y + 50;
viewerWindowPos.w = externalDisplay.size.width;
viewerWindowPos.h = externalDisplay.size.height;
return true;
return false;
}
return false;
}
Expand Down Expand Up @@ -637,6 +637,12 @@ app.on('ready', () => {
createViewer();
}
});

globalShortcut.register('CommandOrControl+Shift+I', () => {
if (mainWindow) {
mainWindow.webContents.openDevTools();
}
});
});

// Quit when all windows are closed.
Expand Down

0 comments on commit 1c199a0

Please sign in to comment.