{"_id":"keyboardevent-key-polyfill","_rev":"7-a1c9407237ab3726af0a016c2aff1cf4","name":"keyboardevent-key-polyfill","time":{"modified":"2022-06-19T08:31:27.638Z","created":"2015-12-23T11:46:36.234Z","1.0.0":"2015-12-23T11:46:36.234Z","1.0.1":"2015-12-23T11:49:28.696Z","1.0.2":"2016-04-08T05:16:51.154Z","1.1.0":"2017-04-07T11:58:56.606Z"},"maintainers":[{"name":"cvan","email":"hearcomestreble@gmail.com"}],"dist-tags":{"latest":"1.1.0"},"description":"polyfill for `KeyboardEvent.prototype.key`","readme":"# keyboardevent-key-polyfill\n\nPolyfill for `KeyboardEvent.prototype.key`.\n\n> **NOTE:** All major browsers [now support `KeyboardEvent.prototype.key`](http://caniuse.com/#feat=keyboardevent-key). Firefox already shipped with this for a while; recent versions of Edge, Chrome, and Safari also now have shipped support. This will still enable `KeyboardEvent.prototype.key` in environments where it may not yet be available.\n\n\n## Example\n\n__[View Demo](https://cvan.io/keyboardevent-key-polyfill/)__\n\n<hr>\n\nSay goodbye to this:\n\n```js\ndocument.addEventListener('keydown', function (e) {\n  console.log('Code of key pressed:', e.which || e.keyCode);  // 39\n});\n```\n\nAnd hello to this:\n\n```js\ndocument.addEventListener('keydown', function (e) {\n  console.log('Name of key pressed:', e.key);  // ArrowRight\n});\n```\n\n## Usage\n\n### From standalone script\n\nJust drop the script on your page and call the `polyfill` method.\n\n```html\n<script src=\"index.js\"></script>\n<script>keyboardeventKeyPolyfill.polyfill();</script>\n```\n\nIf you're using AMD:\n\n```js\nrequire('keyboardevent-key-polyfill').polyfill();\n```\n\n### From npm (Node/Browserify/WebPack)\n\nInstall from [npm](https://www.npmjs.com/package/keyboardevent-key-polyfill):\n\n```bash\nnpm install keyboardevent-key-polyfill\n```\n\nThen require the CommonJS module for use with [Browserify](http://browserify.org)/[webpack](https://webpack.js.org/):\n\n```js\nrequire('keyboardevent-key-polyfill').polyfill();\n```\n\n\n## License\n\nAll code and content within this source-code repository is licensed under the [**Creative Commons Zero v1.0 Universal** license (CC0 1.0 Universal; Public Domain Dedication)](LICENSE.md).\n\nYou can copy, modify, distribute and perform this work, even for commercial purposes, all without asking permission.\n\nFor more information, refer to these following links:\n\n* a copy of the [license](LICENSE.md) in [this source-code repository](https://github.com/cvan/keyboardevent-key-polyfill)\n* the [human-readable summary](https://creativecommons.org/publicdomain/zero/1.0/) of the [full text of the legal code](https://creativecommons.org/publicdomain/zero/1.0/legalcode)\n* the [full text of the legal code](https://creativecommons.org/publicdomain/zero/1.0/legalcode)\n","versions":{"1.0.1":{"name":"keyboardevent-key-polyfill","version":"1.0.1","description":"polyfill for `KeyboardEvent.prototype.key`","main":"index.js","author":{"name":"Chris Van","url":"https://twitter.com/cvanw/"},"license":"MIT","homepage":"https://github.com/cvan/keyboardevent-key-polyfill/","repository":{"type":"git","url":"git+https://github.com/cvan/keyboardevent-key-polyfill.git"},"bugs":{"url":"https://github.com/cvan/keyboardevent-key-polyfill/issues"},"keywords":["polyfill","event","keyboard","keyboard-event","key","key-event","client-side","browser"],"gitHead":"1971538d4c2e311e348dd2174d2c5f1d8d465fe7","_id":"keyboardevent-key-polyfill@1.0.1","scripts":{},"_shasum":"2def5cea71d3f154c72a8cb492e9abdfc214a1b5","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"cvan","email":"hearcomestreble@gmail.com"},"dist":{"shasum":"2def5cea71d3f154c72a8cb492e9abdfc214a1b5","tarball":"https://registry.npmjs.org/keyboardevent-key-polyfill/-/keyboardevent-key-polyfill-1.0.1.tgz","integrity":"sha512-PuCDlNdWw5eVE3UqdRuZPmjpfFsJP+JyjQwCp7i4VC9nTwjPg53MhaJVL8/2A3SrjOj4dGKhwsm8d915ydmOQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1x5fe2Z5vqhNxyy9BWbhUXc/bloigExSOtEmW90tHYwIhAJeV3TIQf5WlUPnbkVOhBljsKeJ14ep+WicT1G6BDQSK"}]},"maintainers":[{"name":"cvan","email":"hearcomestreble@gmail.com"}]},"1.0.2":{"name":"keyboardevent-key-polyfill","version":"1.0.2","description":"polyfill for `KeyboardEvent.prototype.key`","main":"index.js","author":{"name":"Chris Van","url":"https://twitter.com/cvanw/"},"license":"MIT","homepage":"https://github.com/cvan/keyboardevent-key-polyfill/","repository":{"type":"git","url":"git+https://github.com/cvan/keyboardevent-key-polyfill.git"},"bugs":{"url":"https://github.com/cvan/keyboardevent-key-polyfill/issues"},"keywords":["polyfill","event","keyboard","keyboard-event","key","key-event","client-side","browser"],"gitHead":"1fbb863a7c5e42df7a39837b404e3da9d563be30","_id":"keyboardevent-key-polyfill@1.0.2","scripts":{},"_shasum":"3b58c8bbdef2d92212cb3ee0af59091425354473","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"cvan","email":"hearcomestreble@gmail.com"},"dist":{"shasum":"3b58c8bbdef2d92212cb3ee0af59091425354473","tarball":"https://registry.npmjs.org/keyboardevent-key-polyfill/-/keyboardevent-key-polyfill-1.0.2.tgz","integrity":"sha512-8fztiTzRcSqrWCO4t+wyvbLM9PFkxm8crIS/iriu0NJIv8/Nj+uj7KFQuK3Rn8DS8CWDC75YqCgVdzn09A2SKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLxHHVkd+XfpN03J4IqRZUvRxnG60oiaRjW2NGN3wmvQIgWgHkrumGZ2AkPuDJ0p5CGPU9N0pExedFsJY47d17Gr4="}]},"maintainers":[{"name":"cvan","email":"hearcomestreble@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/keyboardevent-key-polyfill-1.0.2.tgz_1460092610471_0.07229271461255848"}},"1.1.0":{"name":"keyboardevent-key-polyfill","version":"1.1.0","description":"polyfill for `KeyboardEvent.prototype.key`","main":"index.js","author":{"name":"Chris Van","url":"https://twitter.com/cvanw/"},"license":"CC0-1.0","homepage":"https://github.com/cvan/keyboardevent-key-polyfill/","repository":{"type":"git","url":"git+https://github.com/cvan/keyboardevent-key-polyfill.git"},"bugs":{"url":"https://github.com/cvan/keyboardevent-key-polyfill/issues"},"keywords":["polyfill","event","keyboard","keyboard-event","key","key-event","client-side","browser"],"gitHead":"76f3a0ee27fdea95da7d7166ef948e24712ca9cd","_id":"keyboardevent-key-polyfill@1.1.0","scripts":{},"_shasum":"8a319d8e45a13172fca56286372f90c1d4c7014c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"cvan","email":"hearcomestreble@gmail.com"},"dist":{"shasum":"8a319d8e45a13172fca56286372f90c1d4c7014c","tarball":"https://registry.npmjs.org/keyboardevent-key-polyfill/-/keyboardevent-key-polyfill-1.1.0.tgz","integrity":"sha512-NTDqo7XhzL1fqmUzYroiyK2qGua7sOMzLav35BfNA/mPUSCtw8pZghHFMTYR9JdnJ23IQz695FcaM6EE6bpbFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMyriLvphbLSQIGyKDnDSvjCAV30vLcEdp0LKK878IUgIgaTZB2L7nNoLhqW2OhaJtpsuDduRcVUGF6nB6JS0UW+k="}]},"maintainers":[{"name":"cvan","email":"hearcomestreble@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/keyboardevent-key-polyfill-1.1.0.tgz_1491566334650_0.9654554843436927"}}},"homepage":"https://github.com/cvan/keyboardevent-key-polyfill/","keywords":["polyfill","event","keyboard","keyboard-event","key","key-event","client-side","browser"],"repository":{"type":"git","url":"git+https://github.com/cvan/keyboardevent-key-polyfill.git"},"author":{"name":"Chris Van","url":"https://twitter.com/cvanw/"},"bugs":{"url":"https://github.com/cvan/keyboardevent-key-polyfill/issues"},"license":"CC0-1.0","readmeFilename":"README.md"}