{"id":20447629,"url":"https://github.com/acrool/acrool-react-hotkey","last_synced_at":"2025-04-13T01:10:40.797Z","repository":{"id":257793337,"uuid":"862526368","full_name":"acrool/acrool-react-hotkey","owner":"acrool","description":"Listener hotkey component by reactjs","archived":false,"fork":false,"pushed_at":"2025-03-08T06:38:13.000Z","size":397,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T19:03:10.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acrool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-24T18:41:43.000Z","updated_at":"2025-03-08T06:38:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"94bea317-01f0-4664-9cec-a2928f7fb4c2","html_url":"https://github.com/acrool/acrool-react-hotkey","commit_stats":null,"previous_names":["acrool/acrool-react-hotkey"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrool%2Facrool-react-hotkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrool%2Facrool-react-hotkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrool%2Facrool-react-hotkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acrool%2Facrool-react-hotkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acrool","download_url":"https://codeload.github.com/acrool/acrool-react-hotkey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650750,"owners_count":21139681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-15T10:28:05.087Z","updated_at":"2025-04-13T01:10:40.792Z","avatar_url":"https://github.com/acrool.png","language":"TypeScript","funding_links":[],"categories":["React underlying structure"],"sub_categories":[],"readme":"# Acrool React Hotkey\n\n\u003ca href=\"https://acrool-react-hotkey.pages.dev/\" title=\"Acrool React Hotkey - This is a hotkey component for ReactJs\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/acrool/acrool-react-hotkey/main/example/public/og.webp\" alt=\"Acrool React Hotkey Logo\"/\u003e\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n    This is a toast message function for React development notifications\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![NPM](https://img.shields.io/npm/v/@acrool/react-hotkey.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-hotkey)\n[![npm](https://img.shields.io/bundlejs/size/@acrool/react-hotkey?style=for-the-badge)](https://github.com/acrool/@acrool/react-hotkey/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/l/@acrool/react-hotkey?style=for-the-badge)](https://github.com/acrool/react-hotkey/blob/main/LICENSE)\n\n[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-hotkey.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-hotkey)\n[![npm](https://img.shields.io/npm/dt/@acrool/react-hotkey.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-hotkey)\n\n\u003c/div\u003e\n\n\n\n\n## Features\n\n- Supports dom onKeyDown\n- Supports not repeat onKeyDown\n- componentOnMount add listen, componentUnMount remove listen\n\n## Install\n\n```bash\nyarn add @acrool/react-hotkey\n```\n\n## Usage\n\n```tsx\nimport {generateOnKeydown, HotkeyListener} from '@acrool/react-hotkey';\n\nconst Example = () =\u003e {\n    const handleSave = () =\u003e {\n        // white yourr code\n    }\n    const handleCancel = () =\u003e {\n        // white yourr code\n    }\n    \n    /**\n     * Save\n     */\n    const handleOnKeyDown = (e) =\u003e {\n        generateOnKeydown('ctrl+enter', handleSave)(e);\n        generateOnKeydown('escape', handleCancel)(e);\n    };\n    \n    return (\u003c\u003e\n            \u003cinput type=\"text\" onKeyDown={handleOnKeyDown}/\u003e\n            \u003cHotkeyListener hotKey=\"ctrl+,\" onKeyDown={() =\u003e console.log('to setting')} /\u003e\n        \u003c/\u003e\n    );\n};\n```\n\nThere is also a example that you can play with it:\n\n[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-hotkey/main/play-in-example-button.svg)](https://acrool-react-hotkey.pages.dev)\n\n\n## License\n\nMIT © [Acrool](https://github.com/acrool) \u0026 [Imagine](https://github.com/imagine10255)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrool%2Facrool-react-hotkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facrool%2Facrool-react-hotkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facrool%2Facrool-react-hotkey/lists"}