{"id":16920691,"url":"https://github.com/dherault/piano-keys","last_synced_at":"2025-08-08T18:34:04.491Z","repository":{"id":34245199,"uuid":"173432959","full_name":"dherault/piano-keys","owner":"dherault","description":"A JavaScript shorcuts and hotkeys librairy","archived":false,"fork":false,"pushed_at":"2023-03-15T00:07:05.000Z","size":1270,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T03:51:20.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dherault.github.io/piano-keys/","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/dherault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-02T10:15:17.000Z","updated_at":"2022-04-21T15:51:24.000Z","dependencies_parsed_at":"2023-02-18T10:18:17.710Z","dependency_job_id":null,"html_url":"https://github.com/dherault/piano-keys","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2Fpiano-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2Fpiano-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2Fpiano-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2Fpiano-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dherault","download_url":"https://codeload.github.com/dherault/piano-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345070,"owners_count":20924062,"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-10-13T19:49:13.112Z","updated_at":"2025-04-05T13:40:25.991Z","avatar_url":"https://github.com/dherault.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Piano keys\n\n[![npm version](https://badge.fury.io/js/piano-keys.svg)](https://badge.fury.io/js/piano-keys)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](#contributing)\n\nA JavaScript hotkeys librairy in less than 3KB.\n\nCheckout the [demo](https://dherault.github.io/piano-keys/)!\n\n## Installation\n\n```\nnpm install piano-keys --save\n```\n\n## Usage\n\n```js\nimport hotkeys from 'piano-keys'\n\nconst element = document.getElementById('hello')\n\nhotkeys(element, 'ctrl+b', () =\u003e console.log('bold'))\nhotkeys(element, 'cmd+k a', () =\u003e console.log('super settings'))\nhotkeys(element, 'up up down down left right left right b a', () =\u003e console.log('konami code'))\nhotkeys(element, '1', () =\u003e console.log('fire on keyup'), true)\n\n// To unregister the listeners use the return function\nconst unregisterHotkeys = hotkeys(element, 'a', () =\u003e console.log('pressed a'))\n\nunregisterHotkeys()\n```\n\nAvailable descriptors:\n`ctrl shift alt altgr cmd enter tab space backspace escape capslock up down left right plus contextmenu delete insert pause home end numlock`\n\n## Usage with react\n\nCheckout [react-piano-keys](https://www.npmjs.com/package/react-piano-keys)\n\n## Contributing\n\nYes, thank you.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdherault%2Fpiano-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdherault%2Fpiano-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdherault%2Fpiano-keys/lists"}