Fix sample code indention
This commit is contained in:
parent
fb99bfac52
commit
fc9612a5ed
1 changed files with 13 additions and 13 deletions
|
@ -10,25 +10,25 @@ var app = require('app');
|
||||||
var globalShortcut = require('global-shortcut');
|
var globalShortcut = require('global-shortcut');
|
||||||
|
|
||||||
app.on('ready', function() {
|
app.on('ready', function() {
|
||||||
// Register a 'ctrl+x' shortcut listener.
|
// Register a 'ctrl+x' shortcut listener.
|
||||||
var ret = globalShortcut.register('ctrl+x', function() {
|
var ret = globalShortcut.register('ctrl+x', function() {
|
||||||
console.log('ctrl+x is pressed');
|
console.log('ctrl+x is pressed');
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
console.log('registration failed');
|
console.log('registration failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether a shortcut is registered.
|
// Check whether a shortcut is registered.
|
||||||
console.log(globalShortcut.isRegistered('ctrl+x'));
|
console.log(globalShortcut.isRegistered('ctrl+x'));
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('will-quit', function() {
|
app.on('will-quit', function() {
|
||||||
// Unregister a shortcut.
|
// Unregister a shortcut.
|
||||||
globalShortcut.unregister('ctrl+x');
|
globalShortcut.unregister('ctrl+x');
|
||||||
|
|
||||||
// Unregister all shortcuts.
|
// Unregister all shortcuts.
|
||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue