Improve app-command docs, list arguments and explain command string

This commit is contained in:
James Wheare 2016-03-31 08:56:49 +01:00
parent 996ad10344
commit d4a14bc215

View file

@ -301,10 +301,18 @@ Emitted when the window leaves full screen state triggered by html api.
### Event: 'app-command' _Windows_ ### 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) 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 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, 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 ```js
someWindow.on('app-command', function(e, cmd) { someWindow.on('app-command', function(e, cmd) {
// Navigate the window back when the user hits their mouse back button // Navigate the window back when the user hits their mouse back button