{"id":18763669,"url":"https://github.com/officialpesonen/use-keybinds","last_synced_at":"2025-10-19T07:03:53.651Z","repository":{"id":226023611,"uuid":"767527583","full_name":"OfficialPesonen/use-keybinds","owner":"OfficialPesonen","description":"A lightweight and typesafe library for managing keybinds in React applications.","archived":false,"fork":false,"pushed_at":"2025-05-24T14:20:16.000Z","size":232,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T23:06:15.341Z","etag":null,"topics":["keybinds","react"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/use-keybinds","language":"TypeScript","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/OfficialPesonen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-03-05T13:06:30.000Z","updated_at":"2025-05-24T14:20:19.000Z","dependencies_parsed_at":"2025-06-30T23:06:16.380Z","dependency_job_id":"30a36636-41ae-4b26-9c17-d60e48d6f77e","html_url":"https://github.com/OfficialPesonen/use-keybinds","commit_stats":null,"previous_names":["officialpesonen/use-keybinds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OfficialPesonen/use-keybinds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficialPesonen%2Fuse-keybinds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficialPesonen%2Fuse-keybinds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficialPesonen%2Fuse-keybinds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficialPesonen%2Fuse-keybinds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OfficialPesonen","download_url":"https://codeload.github.com/OfficialPesonen/use-keybinds/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficialPesonen%2Fuse-keybinds/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266057193,"owners_count":23870121,"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":["keybinds","react"],"created_at":"2024-11-07T18:26:58.110Z","updated_at":"2025-10-19T07:03:53.525Z","avatar_url":"https://github.com/OfficialPesonen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-keybinds\nA lightweight and typesafe library for managing keybinds in React applications.\n\n## Features\n- Single keypresses such as (ArrowUP)\n- Multiple keypresses such as (Ctrl + C)\n- Sequential keypresses such as (G then H)\n\n## Usage\n```tsx\nimport {KeybindsProvider, useKeybinds} from \"use-keybinds\";\n\n// Optional but heavily recommended for type safety\nexport type KeybindSlug = \"SUBMIT\" | \"GO_TO_HOME\";\n\nconst App = () =\u003e {\n    return (\n        \u003cKeybindsProvider\u003cKeybindSlug\u003e\n            keybinds={{\n                SUBMIT: {\n                    name: \"Submit form\",\n                    keybind: [\"Enter\"]\n                },\n                GO_TO_HOME: {\n                    name: \"Go to home\",\n                    keybind: [\"KeyG\", \"KeyH\"],\n                    isSequential: true\n                }\n            }}\n        \u003e\n            \u003cComponent/\u003e\n        \u003c/KeybindsProvider\u003e\n    );\n};\n\nconst Component = () =\u003e {\n    const [current, setCurrent] = useState\u003cstring\u003e(\"\");\n\n    useKeybinds\u003cKeybindSlug\u003e({\n        SUBMIT: (e) =\u003e {\n            e.preventDefault();\n            setCurrent(\"submit\")\n        },\n        GO_TO_HOME: (e) =\u003e {\n            e.preventDefault();\n            setCurrent(\"go to home\")\n        }\n    })\n\n    return (\n        \u003cdiv\u003e\n            \u003cp\u003eCurrent keybind: {current}\u003c/p\u003e\n        \u003c/div\u003e\n    )\n}\n```\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpesonen%2Fuse-keybinds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofficialpesonen%2Fuse-keybinds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficialpesonen%2Fuse-keybinds/lists"}