mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-30 20:44:31 +00:00
fix: bind F12 and Ctrl+Shift+I to DevTools on all platforms
This commit is contained in:
parent
3e7e709884
commit
3360480a2a
1 changed files with 12 additions and 0 deletions
|
|
@ -294,6 +294,18 @@ function wireWindowDiagnostics(win: BrowserWindow, label: string) {
|
|||
})
|
||||
})
|
||||
|
||||
// DevTools accelerators on Windows/Linux where the menu isn't created.
|
||||
win.webContents.on("before-input-event", (_event, input) => {
|
||||
if (input.type !== "keyDown") return
|
||||
const key = input.key
|
||||
const toggle =
|
||||
key === "F12" ||
|
||||
(input.control && input.shift && (key === "I" || key === "i")) ||
|
||||
(input.meta && input.alt && (key === "I" || key === "i"))
|
||||
if (!toggle) return
|
||||
win.webContents.toggleDevTools()
|
||||
})
|
||||
|
||||
win.on("unresponsive", () => {
|
||||
logger.error(`${label} window became unresponsive`)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue