Adds useful debug features to your Electron app
86
Build an Electron application module that manages window-specific keyboard shortcuts. The module should allow registering different keyboard shortcuts for individual windows without those shortcuts interfering with other windows or system-wide shortcuts.
Register keyboard shortcuts that only work when a specific window has focus.
Multiple windows can have the same accelerator without conflicts.
Clean up shortcuts when windows are closed or when explicitly requested.
@generates
/**
* Register a keyboard shortcut for a specific window
* @param {BrowserWindow} window - The Electron window to register the shortcut for
* @param {string} accelerator - The keyboard shortcut (e.g., 'Ctrl+R', 'F5')
* @param {Function} callback - Function to call when shortcut is triggered
*/
function registerShortcut(window, accelerator, callback) {}
/**
* Unregister a specific shortcut for a window
* @param {BrowserWindow} window - The Electron window
* @param {string} accelerator - The keyboard shortcut to remove
*/
function unregisterShortcut(window, accelerator) {}
/**
* Unregister all shortcuts for a specific window
* @param {BrowserWindow} window - The Electron window
*/
function unregisterAll(window) {}
module.exports = {
registerShortcut,
unregisterShortcut,
unregisterAll
};Provides window-specific keyboard shortcut registration that works independently per window without interfering with global shortcuts.
Provides the Electron BrowserWindow API for window management.
Install with Tessl CLI
npx tessl i tessl/npm-electron-debugdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10