Fix Ctrl+Q shortcut by intercepting BrowserView keyboard events #36
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Public/castroix!36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/fix-control-q-shortcut"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Ctrl+Q shortcut fails to close embedded browser sessions because
globalShortcut.register()doesn't receive events when BrowserView has focus—the view consumes keyboard input before it reaches the global handler.Changes
main.js
before-input-eventlistener to BrowserView webContents to intercept Escape and Ctrl+Q before web content processes themtest_electron.js
before-input-eventhandler exists and captures both shortcutsARCHITECTURE.md
before-input-eventis necessary for BrowserView keyboard shortcutsImplementation
The handler fires before the web page receives input, allowing us to capture shortcuts regardless of what content is loaded in the embedded browser.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.