mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
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:
1 file changed
+14
@@ -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
|
||||
|
||||
Reference in new issue
Block a user