{"id":13422381,"url":"https://github.com/ayrton/react-key-handler","last_synced_at":"2026-04-13T21:05:34.572Z","repository":{"id":57333611,"uuid":"52687184","full_name":"ayrton/react-key-handler","owner":"ayrton","description":"React component to handle keyboard events :key:","archived":false,"fork":false,"pushed_at":"2018-09-05T10:36:03.000Z","size":492,"stargazers_count":388,"open_issues_count":6,"forks_count":29,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-22T19:15:51.996Z","etag":null,"topics":["key-event","keyboard","react","react-component","react-components","reactjs","reactjs-component","reactjs-components"],"latest_commit_sha":null,"homepage":"http://ayrton.be/react-key-handler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayrton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-27T20:27:48.000Z","updated_at":"2025-07-30T11:48:31.000Z","dependencies_parsed_at":"2022-08-24T18:50:25.775Z","dependency_job_id":null,"html_url":"https://github.com/ayrton/react-key-handler","commit_stats":null,"previous_names":["producthunt/react-key-handler"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ayrton/react-key-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrton%2Freact-key-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrton%2Freact-key-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrton%2Freact-key-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrton%2Freact-key-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayrton","download_url":"https://codeload.github.com/ayrton/react-key-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayrton%2Freact-key-handler/sbom","scorecard":{"id":220756,"data":{"date":"2025-08-11","repo":{"name":"github.com/ayrton/react-key-handler","commit":"336077267caed44d29cb0381265b69d488ea9b2d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 3/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"118 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9","Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-675m-85rw-j3w4","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-37q6-576q-vgr7","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-wvhm-4hhf-97x9","Warn: Project is vulnerable to: GHSA-h4hr-7fg3-h35w","Warn: Project is vulnerable to: GHSA-gj77-59wh-66hg","Warn: Project is vulnerable to: GHSA-hqhp-5p83-hx96","Warn: Project is vulnerable to: GHSA-3949-f494-cm99","Warn: Project is vulnerable to: GHSA-x7hr-w5r2-h6wg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-hgch-jjmr-gp7w","Warn: Project is vulnerable to: GHSA-r3x4-wr4h-pw33","Warn: Project is vulnerable to: GHSA-876r-hj45-fw7g","Warn: Project is vulnerable to: GHSA-v63x-xc9j-hhvq","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-w5q7-3pr9-x44w","Warn: Project is vulnerable to: GHSA-3fjq-93xj-3f3f","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-x9hc-rw35-f44h","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:25:43.975Z","repository_id":57333611,"created_at":"2025-08-17T02:25:43.976Z","updated_at":"2025-08-17T02:25:43.976Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31770780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["key-event","keyboard","react","react-component","react-components","reactjs","reactjs-component","reactjs-components"],"created_at":"2024-07-30T23:00:43.246Z","updated_at":"2026-04-13T21:05:34.558Z","avatar_url":"https://github.com/ayrton.png","language":"JavaScript","funding_links":[],"categories":["UI Utilities","UI Components","JavaScript","UI Utilites"],"sub_categories":["Device Input","Device Input/User Action"],"readme":"# react-key-handler 🔑\n\n[![npm version](https://img.shields.io/npm/v/react-key-handler.svg)](https://www.npmjs.com/package/react-key-handler) [![License](https://img.shields.io/npm/l/react-key-handler.svg)](https://www.npmjs.com/package/react-key-handler) [![Build Status](https://travis-ci.org/ayrton/react-key-handler.svg?branch=master)](https://travis-ci.org/ayrton/react-key-handler)\n\nReact component to handle keyboard events (such as `keyup`, `keydown` \u0026 `keypress`).\n\n## Testimonials\n\n\u003e \u003cdiv\u003e“Happy to see that react-key-handler is SSR safe :+1:”\u003c/div\u003e\n\u003e [Veselin Todorov](https://github.com/vesln), Chai.js core\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Usage](#usage)\n   1. [Higher-order Components](#higher-order-components)\n   2. [Component](#component)\n   3. [Form key handling](#form-key-handling)\n3. [Key event names](#key-event-names)\n4. [`keyValue`, `code` and `keyCode`](#keyvalue-code-and-keycode)\n5. [Development](#development)\n   1. [Setup](#setup)\n   2. [Getting started](#getting-started)\n   3. [Tests](#tests)\n6. [Contributing](#contributing)\n7. [License](#license)\n\n## Installation\n\n```sh\n$ npm install react-key-handler --save\n```\n\n## Usage\n\nYou can use `react-key-handler` library in two flavours:\n\n- [higher-order components](#higher-order-components)\n- [component](#component)\n\n### Higher-order Components\n\nThis library includes two similar higher-order components, but with a different puprose:\n\n| Higher-order Component | Purpose             |\n| ---------------------- | ------------------- |\n| `keyHandler`           | Handles key changes |\n| `keyToggleHandler`     | Handles key toggles |\n\nBoth have the same API and will decorate the given component with a `keyValue`, `code`\nand `keyCode` property.\n\nInternally the `KeyHandler` component is used, for a full understanding be sure to\ncheck out [the implementation](lib/key-handler.js).\n\n```jsx\nimport React from 'react';\nimport { keyHandler, KEYPRESS } from 'react-key-handler';\n\nfunction Demo({ keyValue }) {\n  return (\n    \u003cdiv\u003e\n      {keyValue === 's' \u0026\u0026 (\n        \u003col\u003e\n          \u003cli\u003ehello\u003c/li\u003e\n          \u003cli\u003eworld\u003c/li\u003e\n        \u003c/ol\u003e\n      )}\n    \u003c/div\u003e\n  );\n}\n\nexport default keyHandler({ keyEventName: KEYPRESS, keyValue: 's' })(Demo);\n```\n\nThe prop types of the `KeyHandler` component are:\n\n| Name            | Type   | Required   | Default   |                                        |\n| --------------- | ------ | ---------- | --------- | -------------------------------------- |\n| keyEventName    | string | no         | `'keyup'` | `'keydown'`, `'keypress'` or `'keyup'` |\n| keyValue        | string | yes **\\*** |           | Any given [KeyboardEvent.key]          |\n| code            | string | yes **\\*** |           | Any given [KeyboardEvent.code]         |\n| keyCode\u0026dagger; | number | yes **\\*** |           | Any given [KeyboardEvent.keyCode]      |\n\n**\\*** You should pass at least one of these props.\n\n\u0026dagger; _Note_ that the keyCode is frequently browser specific and has therefore be set as\ndeprecated, see [MDN for details](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).\n\n[Examples](demo/components/examples/decorators/)\n\n### Component\n\n```jsx\nimport React from 'react';\nimport KeyHandler, { KEYPRESS } from 'react-key-handler';\n\nexport default class Demo extends React.Component {\n  state = { showMenu: false };\n\n  render() {\n    const { showMenu } = this.state;\n\n    return (\n      \u003cReact.Fragment\u003e\n        \u003cKeyHandler\n          keyEventName={KEYPRESS}\n          keyValue=\"s\"\n          onKeyHandle={this.toggleMenu}\n        /\u003e\n\n        {showMenu \u0026\u0026 (\n          \u003col\u003e\n            \u003cli\u003ehello\u003c/li\u003e\n            \u003cli\u003eworld\u003c/li\u003e\n          \u003c/ol\u003e\n        )}\n      \u003c/React.Fragment\u003e\n    );\n  },\n\n  toggleMenu = (event) =\u003e {\n    event.preventDefault();\n\n    this.setState({ showMenu: !this.state.showMenu });\n  };\n}\n```\n\nThe prop types of the `KeyHandler` component are:\n\n| Name            | Type     | Required   | Default   |                                                  |\n| --------------- | -------- | ---------- | --------- | ------------------------------------------------ |\n| keyEventName    | string   | no         | `'keyup'` | `'keydown'`, `'keypress'` or `'keyup'`           |\n| keyValue        | string   | yes **\\*** |           | Any given [KeyboardEvent.key]                    |\n| code            | string   | yes **\\*** |           | Any given [KeyboardEvent.code]                   |\n| keyCode\u0026dagger; | number   | yes **\\*** |           | Any given [KeyboardEvent.keyCode]                |\n| onKeyHandle     | function | yes        |           | Function that is called when they key is handled |\n\n**\\*** You should pass at least one of these props.\n\n\u0026dagger; _Note_ that the keyCode is frequently browser specific and has therefore be set as\ndeprecated, see [MDN for details](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).\n\n[Example](demo/components/examples/component/index.js)\n\n### Form key handling\n\nThis library does not handle key events for form elements such as `\u003cinput /\u003e` and `\u003ctextarea /\u003e`.\n\nReact does a fine job supporting these already via [keyboard events](https://reactjs.org/docs/events.html#keyboard-events).\n\n[Examples](demo/components/examples/input/)\n\n## Key event names\n\nTODO: explain the differences between the different key events.\n\n## `keyValue`, `code` and `keyCode`\n\nThe three available key events are\n\n- `keyValue` This corresponds to the true value. This is the value of the key pressed\n  by the user while taking into considerations the state of modifier keys\n  such as the `shiftKey` as well as the keyboard locale/layout\n- `code` This corresponds to the physical key on the keyboard (as opposed to the\n  character generated by pressing the key). In other words, this property\n  returns a value which isn't altered by keyboard layout or the state of\n  the modifier keys. The value is a string specific to the key, e.g. 'Digit0'\n- `keyCode` This is similar to code but numeric and also _deprecated_.\n\nWe recommend you to use the new Web standard [KeyboardEvent.key] or the [KeyboardEvent.code]\nover the deprecated [KeyboardEvent.keyCode].\n\nNote that in **React** `key` is a reserved property, and thus we use `keyValue` when referring\nto the `key` property.\n\n**Browser support:**\n\nThere's no need to worry about browser support because internally we normalize\ndeprecated HTML5 `keyValue` values and translate from legacy `keyCode` values,\nsimilar to how React does this for their `SyntheticKeyboardEvent`.\n\n**More information:**\n\n[W3C Working Draft].\n\n## Development\n\n### Setup\n\n```sh\n$ git clone \u003cthis repo\u003e\n$ cd react-key-handler\n$ npm install\n```\n\n### Getting started\n\nTo start the server:\n\n```sh\n$ npm demo\n```\n\nThis starts a development server, which will automatically rebuild the demo app as you change files and supports hot module replacement for fast development:\n\n```sh\n$ open http://localhost:1234\n```\n\n### Tests\n\nTo run all tests:\n\n```sh\n$ npm test\n```\n\nOr you can run the linters, unit tests and check for type errors individually:\n\n```sh\n$ npm run test:lint\n$ npm run test:unit\n$ npm run test:flow\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub. This project is intended to be a\nsafe, welcoming space for collaboration, and contributors are expected to adhere\nto the [Contributor Covenant](http://contributor-covenant.org/) code of conduct.\n\n## License\n\n```\n _________________\n\u003c The MIT License \u003e\n -----------------\n        \\   ^__^\n         \\  (oo)\\_______\n            (__)\\       )\\/\\\n                ||----w |\n                ||     ||\n```\n\n[w3c working draft]: https://www.w3.org/TR/DOM-Level-3-Events-key/\n[keyboardevent.key]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n[keyboardevent.code]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code\n[keyboardevent.keycode]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n[key]: https://facebook.github.io/react/docs/create-fragment.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayrton%2Freact-key-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayrton%2Freact-key-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayrton%2Freact-key-handler/lists"}