Skip to content

Instantly share code, notes, and snippets.

@jiafangtao
Created October 31, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiafangtao/dba1a2bae667c8d24172863db3fbe600 to your computer and use it in GitHub Desktop.
Save jiafangtao/dba1a2bae667c8d24172863db3fbe600 to your computer and use it in GitHub Desktop.
// register global shortcuts
var { globalShortcut } = require('electron');
var ret = globalShortcut.register('CommandOrControl+Down', function () {
console.log ('Key down is pressed with globalShortcut');
});
if (!ret) {
console.log ('failed to register shortcut');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment