w3c-keyname
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -91,2 +91,3 @@ var base = { | ||
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform) | ||
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent) | ||
var brokenModifierNames = chrome && (mac || +chrome[1] < 57) || gecko && mac | ||
@@ -113,3 +114,3 @@ | ||
var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) || | ||
safari && event.shiftKey && event.key && event.key.length == 1 | ||
(safari || ie) && event.shiftKey && event.key && event.key.length == 1 | ||
var name = (!ignoreKey && event.key) || | ||
@@ -116,0 +117,0 @@ (event.shiftKey ? shift : base)[event.keyCode] || |
{ | ||
"name": "w3c-keyname", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Get a KeyboardEvent.key-style string from an event", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,4 +12,8 @@ # W3C keyname | ||
predicted based on a hard-coded table. Meant as a fallback for | ||
`KeyboardEvent.name`, not a replacement. | ||
`KeyboardEvent.key`, not a replacement. | ||
The lookup tables from key codes (`event.keyCode`) to names are | ||
exported as `base` (when Shift isn't held) and `shift` (when Shift is | ||
held). | ||
License: MIT |
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
5503
122
19