Merge pull request #4964 from jwheare/app-command-docs

Improve app-command docs, list arguments and explain command string
This commit is contained in:
Kevin Sawicki 2016-03-31 15:45:16 -07:00
commit 1eddaecef8

View file

@ -301,10 +301,18 @@ Emitted when the window leaves full screen state triggered by html api.
### Event: 'app-command' _Windows_
Returns:
* `event` Event
* `command` String
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.
Commands are lowercased with underscores replaced with hyphens and the `APPCOMMAND_` prefix stripped off.
e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
```js
someWindow.on('app-command', function(e, cmd) {
// Navigate the window back when the user hits their mouse back button