Sha256: 41ed8063f6bd942f6dc6decbd31a432825ef36f3d84f1be20f4688c3e1e228a3

Contents?: true

Size: 1.5 KB

Versions: 35

Compression:

Stored size: 1.5 KB

Contents

var e={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"};var r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};var t="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);var o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var n=0;n<10;n++)e[48+n]=e[96+n]=String(n);for(n=1;n<=24;n++)e[n+111]="F"+n;for(n=65;n<=90;n++){e[n]=String.fromCharCode(n+32);r[n]=String.fromCharCode(n)}for(var a in e)r.hasOwnProperty(a)||(r[a]=e[a]);function keyName(n){var a=t&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||o&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key;var i=!a&&n.key||(n.shiftKey?r:e)[n.keyCode]||n.key||"Unidentified";"Esc"==i&&(i="Escape");"Del"==i&&(i="Delete");"Left"==i&&(i="ArrowLeft");"Up"==i&&(i="ArrowUp");"Right"==i&&(i="ArrowRight");"Down"==i&&(i="ArrowDown");return i}export{e as base,keyName,r as shift};

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
satis-2.1.43 vendor/javascript/w3c-keyname.js
satis-2.1.42 vendor/javascript/w3c-keyname.js
satis-2.1.41 vendor/javascript/w3c-keyname.js
satis-2.1.40 vendor/javascript/w3c-keyname.js
satis-2.1.39 vendor/javascript/w3c-keyname.js
satis-2.1.38 vendor/javascript/w3c-keyname.js
satis-2.1.37 vendor/javascript/w3c-keyname.js
satis-2.1.36 vendor/javascript/w3c-keyname.js
satis-2.1.35 vendor/javascript/w3c-keyname.js
satis-2.1.33 vendor/javascript/w3c-keyname.js
satis-2.1.31 vendor/javascript/w3c-keyname.js
satis-2.1.30 vendor/javascript/w3c-keyname.js
satis-2.1.29 vendor/javascript/w3c-keyname.js
satis-2.1.28 vendor/javascript/w3c-keyname.js
satis-2.1.27 vendor/javascript/w3c-keyname.js
satis-2.1.26 vendor/javascript/w3c-keyname.js
satis-2.1.24 vendor/javascript/w3c-keyname.js
satis-2.1.23 vendor/javascript/w3c-keyname.js
satis-2.1.22 vendor/javascript/w3c-keyname.js
satis-2.1.21 vendor/javascript/w3c-keyname.js