Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-localshortcut

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-localshortcut - npm Package Compare versions

Comparing version 0.6.1 to 1.0.0

17

index.js

@@ -20,5 +20,7 @@ 'use strict';

const shortcuts = windowsWithShortcuts.get(win);
shortcuts.forEach(sc =>
globalShortcut.unregister(sc.accelerator)
);
if (shortcuts) {
shortcuts.forEach(sc =>
globalShortcut.unregister(sc.accelerator)
);
}
}

@@ -28,6 +30,7 @@

const shortcuts = windowsWithShortcuts.get(win);
shortcuts.forEach(sc =>
globalShortcut.register(sc.accelerator, sc.callback)
);
if (shortcuts) {
shortcuts.forEach(sc =>
globalShortcut.register(sc.accelerator, sc.callback)
);
}
}

@@ -34,0 +37,0 @@

{
"name": "electron-localshortcut",
"version": "0.6.1",
"version": "1.0.0",
"description": "register/unregister a keyboard shortcut locally to a BrowserWindow instance, without using a Menu",

@@ -21,15 +21,5 @@ "repository": "parro-it/electron-localshortcut",

"devDependencies": {
"electron-prebuilt": "^1.2.5",
"xo": "^0.16.0"
},
"xo": {
"esnext": true,
"envs": [
"node",
"browser"
],
"rules": {
"import/no-extraneous-dependencies": "off"
}
"electron": "^1.4.4",
"xo": "^0.17.0"
}
}

@@ -24,23 +24,23 @@ # electron-localshortcut

```javascript
const electronLocalshortcut = require('electron-localshortcut');
const BrowserWindow = require('electron').BrowserWindow;
const electronLocalshortcut = require('electron-localshortcut');
const BrowserWindow = require('electron').BrowserWindow;
const win = new BrowserWindow();
win.loadUrl('https://github.com');
win.show();
const win = new BrowserWindow();
win.loadUrl('https://github.com');
win.show();
electronLocalshortcut.register(win, 'Ctrl+A', () => {
console.log('You pressed ctrl & A');
});
electronLocalshortcut.register(win, 'Ctrl+A', () => {
console.log('You pressed ctrl & A');
});
electronLocalshortcut.register(win, 'Ctrl+B', () => {
console.log('You pressed ctrl & B');
});
electronLocalshortcut.register(win, 'Ctrl+B', () => {
console.log('You pressed ctrl & B');
});
console.log(
electronLocalshortcut.isRegistered(win, 'Ctrl+A')
); // true
console.log(
electronLocalshortcut.isRegistered(win, 'Ctrl+A')
); // true
electronLocalshortcut.unregister(win, 'Ctrl+A');
electronLocalshortcut.unregisterAll(win);
electronLocalshortcut.unregister(win, 'Ctrl+A');
electronLocalshortcut.unregisterAll(win);

@@ -132,5 +132,5 @@

Copyright (c) 2015 Andrea Parodi
Copyright (c) 2016 Andrea Parodi

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc