Add a global shortcut to open DevTools

Fixes: https://github.com/resin-io/herostratus/issues/33
This commit is contained in:
Juan Cruz Viotti 2015-11-24 11:43:26 -04:00
parent 0c76a882e6
commit b4c1ee8d3d
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,6 @@ install:
- ps: Install-Product node $env:nodejs_version x64
- npm -g install npm@2
- set PATH=%APPDATA%\npm;%PATH%
- npm install -g electron-prebuilt
- npm install
build: off

View File

@ -21,6 +21,7 @@
* THE SOFTWARE.
*/
var globalShortcut = require('global-shortcut');
var path = require('path');
var app = require('app');
var Menu = require('menu');
@ -49,6 +50,10 @@ app.on('ready', function() {
icon: path.join(__dirname, '..', 'assets', 'icon.png')
});
globalShortcut.register('CmdOrCtrl+Alt+I', function() {
mainWindow.openDevTools();
});
mainWindow.showUrl(path.join(__dirname, 'index.html'));
});
});