Add DevTools keyboard shortcuts (Ctrl+Shift+I, F12)

Even though we removed the menu, users need access to the inspector
for debugging. This adds keyboard shortcuts to toggle DevTools.
This commit is contained in:
Alex Gleason committed 2025-10-24 22:47:37 -05:00
1 parent 50811bde7a
commit 3765e8f8c0
1 file changed
+14
+14
View File
@@ -36,6 +36,20 @@ function createWindow() {
backgroundColor: '#ffffff',
});
// Enable DevTools keyboard shortcut (Ctrl+Shift+I / Cmd+Option+I)
mainWindow.webContents.on('before-input-event', (event, input) => {
// Check for Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac)
if (input.control && input.shift && input.key.toLowerCase() === 'i') {
mainWindow.webContents.toggleDevTools();
event.preventDefault();
}
// Also support F12
if (input.key === 'F12') {
mainWindow.webContents.toggleDevTools();
event.preventDefault();
}
});
// Load the app
if (process.env.ELECTRON_DEV) {
// Development mode - load from Vite dev server