From b4c1ee8d3dc4e73d51eff722ce9d54c1bb907dcc Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 24 Nov 2015 11:43:26 -0400 Subject: [PATCH] Add a global shortcut to open DevTools Fixes: https://github.com/resin-io/herostratus/issues/33 --- appveyor.yml | 1 - lib/herostratus.js | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8cac1081..b53b2019 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/lib/herostratus.js b/lib/herostratus.js index 17418349..b695029e 100644 --- a/lib/herostratus.js +++ b/lib/herostratus.js @@ -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')); }); });