From: Paul Betts Date: Fri, 19 Jun 2015 19:58:47 +0000 (-0700) Subject: :memo: app commands X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b98154431c336618532629a6bf713cc500da18b5;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git :memo: app commands --- diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index b9c78b9..31e7ca5 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -219,6 +219,23 @@ Emitted when devtools is closed. 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() Returns an array of all opened browser windows.