Skip to content

Commit

Permalink
Merge pull request #2000 from Gauravjeetsingh/devtools-shortcut
Browse files Browse the repository at this point in the history
Add a keyboard shortcut to open devtools
  • Loading branch information
Gauravjeetsingh authored Jul 18, 2024
2 parents 3cab3dd + 1c199a0 commit babc69f
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 babc69f

Please sign in to comment.