electron-localshortcut
Advanced tools
Comparing version 3.0.1 to 3.0.2
17
index.js
@@ -6,3 +6,2 @@ 'use strict'; | ||
const {toKeyEvent} = require('keyboardevent-from-electron-accelerator'); | ||
const insp = require('insp'); | ||
const _debug = require('debug'); | ||
@@ -132,10 +131,10 @@ | ||
debug(insp`before-input-event: ${input} is translated to: ${event}`); | ||
debug(`before-input-event: ${input} is translated to: ${event}`); | ||
for (const {eventStamp, callback} of shortcutsOfWindow) { | ||
if (equals(eventStamp, event)) { | ||
debug(insp`eventStamp: ${eventStamp} match`); | ||
debug(`eventStamp: ${eventStamp} match`); | ||
callback(); | ||
return; | ||
} | ||
debug(insp`eventStamp: ${eventStamp} no match`); | ||
debug(`eventStamp: ${eventStamp} no match`); | ||
} | ||
@@ -250,2 +249,6 @@ }; | ||
} else { | ||
if (win.isDestroyed()) { | ||
debug(`Early return because window is destroyed.`); | ||
return; | ||
} | ||
wc = win.webContents; | ||
@@ -255,2 +258,3 @@ } | ||
debug(`Unregistering callback for ${accelerator} on window ${title(win)}`); | ||
_checkAccelerator(accelerator); | ||
@@ -260,2 +264,7 @@ | ||
if (!windowsWithShortcuts.has(wc)) { | ||
debug(`Early return because window has never had shortcuts registered.`); | ||
return; | ||
} | ||
const shortcutsOfWindow = windowsWithShortcuts.get(wc); | ||
@@ -262,0 +271,0 @@ |
{ | ||
"name": "electron-localshortcut", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "register/unregister a keyboard shortcut locally to a BrowserWindow instance, without using a Menu", | ||
@@ -38,3 +38,2 @@ "repository": "parro-it/electron-localshortcut", | ||
"electron-is-accelerator": "^0.1.0", | ||
"insp": "^0.1.0", | ||
"keyboardevent-from-electron-accelerator": "^0.7.0", | ||
@@ -41,0 +40,0 @@ "keyboardevents-areequal": "^0.2.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16660
4
260
- Removedinsp@^0.1.0
- Removedconcordance@2.0.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedfast-diff@1.3.0(transitive)
- Removedfunction-name-support@0.2.0(transitive)
- Removedinsp@0.1.0(transitive)
- Removedjs-string-escape@1.0.1(transitive)
- Removedlodash.clonedeep@4.5.0(transitive)
- Removedlodash.flattendeep@4.4.0(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedmd5-hex@2.0.0(transitive)
- Removedmd5-o-matic@0.1.1(transitive)
- Removedmoment@2.30.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedwell-known-symbols@1.0.0(transitive)