{"id":24460957,"url":"https://github.com/talljack/vue3-hotkey","last_synced_at":"2025-04-08T03:12:08.394Z","repository":{"id":43754422,"uuid":"373772574","full_name":"Talljack/vue3-hotKey","owner":"Talljack","description":"vue3 hooks of keyboard input.","archived":false,"fork":false,"pushed_at":"2024-11-04T04:04:54.000Z","size":943,"stargazers_count":26,"open_issues_count":6,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T17:21:17.545Z","etag":null,"topics":["hooks","hotkeys","vue3"],"latest_commit_sha":null,"homepage":"https://vue3-hot-key-demo.vercel.app/","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/Talljack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["talljack"]}},"created_at":"2021-06-04T08:24:34.000Z","updated_at":"2025-01-19T06:31:08.000Z","dependencies_parsed_at":"2024-03-10T09:36:04.795Z","dependency_job_id":"cc79ad3b-c193-4675-8ed6-e93a14767f40","html_url":"https://github.com/Talljack/vue3-hotKey","commit_stats":{"total_commits":50,"total_committers":8,"mean_commits":6.25,"dds":0.54,"last_synced_commit":"9e25d63f2ca2a539877f6271f2408a8f3ed6674a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talljack%2Fvue3-hotKey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talljack%2Fvue3-hotKey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talljack%2Fvue3-hotKey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talljack%2Fvue3-hotKey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Talljack","download_url":"https://codeload.github.com/Talljack/vue3-hotKey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"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":["hooks","hotkeys","vue3"],"created_at":"2025-01-21T04:16:39.052Z","updated_at":"2025-04-08T03:12:08.376Z","avatar_url":"https://github.com/Talljack.png","language":"TypeScript","funding_links":["https://github.com/sponsors/talljack","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":[],"sub_categories":[],"readme":"# vue3-hotKey\n\n\u003cp align='center'\u003e\n  \u003cimg src='/public/logo.png' width=\"240\" /\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003cb\u003eVue3 hooks of Keyboard input.\u003c/b\u003e\n\u003c/p\u003e\n\n## 📦 Install\n\n```bash\npnpm i vue3-hotkey\n\nor\n\nyarn add vue3-hotkey\n```\n\n## 🦄 Usage\n```typescript\n\u003cscript lang=\"ts\" setup\u003e\nimport useHotkey, { HotKey, RemoveHandler } from 'vue3-hotkey'\nimport { ref } from 'vue'\nconst hotkeys = ref\u003cHotKey[]\u003e([\n  {\n    keys: ['space'],\n    preventDefault: true,\n    handler(keys) {\n      countRef.value += 5\n    }\n  },\n  {\n    keys: ['shift', 'space'],\n    preventDefault: true,\n    handler(keys) {\n      countRef.value -= 100\n    }\n  }\n])\nconst stopArr = useHotkey(hotkeys.value)\n\n// 取消监听快捷键\nconst removeHotKeys = (hk: HotKey) =\u003e {\n  stopArr.foreach((item: RemoveHandler) =\u003e item())\n}\n\u003c/script\u003e\n```\n\n## 🌸 Thanks\nThis project is heavily inspired by the following awesome projects.\n\n- [vue-use-hotkey](https://github.com/XiNiHa/vue-use-hotkey)\n\n## 📄 License\n\n[MIT License](https://github.com/Talljack/vue3-hotKey/blob/main/LICENSE) © 2021-PRESENT [Talljack](https://github.com/Talljack)\n\n## 🍺 Sponsor\n\n如果大家喜欢我的项目的话，可以请我喝杯咖啡哦，谢谢！\n\u003cbr /\u003e\n\u003ca href=\"https://www.yugangcao.com/sponsors\"\u003e\n  \u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=Talljack\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalljack%2Fvue3-hotkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalljack%2Fvue3-hotkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalljack%2Fvue3-hotkey/lists"}