📝 app commands
This commit is contained in:
parent
55a8862374
commit
b98154431c
1 changed files with 17 additions and 0 deletions
|
@ -219,6 +219,23 @@ Emitted when devtools is closed.
|
||||||
|
|
||||||
Emitted when devtools is focused / opened.
|
Emitted when devtools is focused / opened.
|
||||||
|
|
||||||
|
### Event: 'app-command' (Windows):
|
||||||
|
|
||||||
|
Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx) is invoked. These are typically related to keyboard media keys or browser commands, as well as the "Back" button built into some mice on Windows.
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
AppCommands = require('app-command');
|
||||||
|
|
||||||
|
someWindow.on('app-command', function(e, cmd) => {
|
||||||
|
// Navigate the window back when the user hits their mouse back button
|
||||||
|
if (cmd === AppCommands.APPCOMMAND_BROWSER_BACKWARD &&
|
||||||
|
someWindow.webContents.canGoBack()) {
|
||||||
|
someWindow.webContents.goBack();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### Class Method: BrowserWindow.getAllWindows()
|
### Class Method: BrowserWindow.getAllWindows()
|
||||||
|
|
||||||
Returns an array of all opened browser windows.
|
Returns an array of all opened browser windows.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue