{"id":14990253,"url":"https://github.com/zicklepop/key-down","last_synced_at":"2025-04-12T02:06:21.791Z","repository":{"id":243722607,"uuid":"813317164","full_name":"ZicklePop/key-down","owner":"ZicklePop","description":"A web component for quick key commands","archived":false,"fork":false,"pushed_at":"2024-08-11T05:18:28.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-14T02:03:00.812Z","etag":null,"topics":["web-component"],"latest_commit_sha":null,"homepage":"https://zicklepop.github.io/key-down/demo.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZicklePop.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T21:20:49.000Z","updated_at":"2024-08-11T05:18:31.000Z","dependencies_parsed_at":"2024-08-11T06:26:33.886Z","dependency_job_id":"171da632-0f03-4169-a2d0-b8ee84f9c3ea","html_url":"https://github.com/ZicklePop/key-down","commit_stats":null,"previous_names":["zicklepop/key-down"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZicklePop%2Fkey-down","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZicklePop%2Fkey-down/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZicklePop%2Fkey-down/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZicklePop%2Fkey-down/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZicklePop","download_url":"https://codeload.github.com/ZicklePop/key-down/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219849702,"owners_count":16556324,"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":["web-component"],"created_at":"2024-09-24T14:19:47.026Z","updated_at":"2024-10-14T02:03:06.454Z","avatar_url":"https://github.com/ZicklePop.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# key-down\n\nA web component for quick key commands\n\n## Install\n\n```sh\nnpm install --save @zicklepop/key-down\n```\n\n## Resources\n\n- [Demo](http://zicklepop.github.io/key-down/demo.html)\n- [GitHub](https://github.com/zicklepop/key-down)\n- [NPM](https://www.npmjs.com/package/@zicklepop/key-down)\n- [JSR](https://jsr.io/@zicklepop/key-down)\n\n## Properties\n\n- **data-key** _string, required_: The key we are watching to be pressed\n- **data-action** _enum, optional_: Defaults to 'click', but can be set to be 'focus'\n- **data-scroll** _boolean, optional_: If true, the page will scroll the wrapped element in to view\n- **data-altKey** _boolean, optional_: Setting this as true or false will require the alt/option key to be pressed or not, otherwise it will not matter.\n- **data-ctrlKey** _boolean, optional_: Setting this as true or false will require the control key to be pressed or not, otherwise it will not matter.\n- **data-metaKey** _boolean, optional_: Setting this as true or false will require the meta/Windows/command key to be pressed or not, otherwise it will not matter.\n- **data-shiftKey** _boolean, optional_: Setting this as true or false will require the shift key to be pressed or not, otherwise it will not matter. If you just want to monitor for a capital letter or symbol, it is recommended to set the `data-key` value to it (ie `A` or `!`)\n\n## Basic Usage\n\nJust requires a clickable child element\n\n```html\n\u003ckey-down data-key=\"a\"\u003e\n  \u003cbutton\u003e\u003c/button\u003e\n\u003c/key-down\u003e\n```\n\n## With Defined Action\n\nBy default, the web component will click the child when the key is pressed, but you can pass in an action like 'focus' for input boxes.\n\n```html\n\u003ckey-down data-key=\"b\" data-action=\"focus\"\u003e\n  \u003cinput type=\"text\" placeholder=\"Press 'b' key\" /\u003e\n\u003c/key-down\u003e\n```\n\n## With Everything\n\nUsing every manual property.\n\n```html\n\u003ckey-down\n  data-key=\"b\"\n  data-action=\"focus\"\n  data-scroll=\"true\"\n  data-altKey=\"false\"\n  data-ctrlKey=\"true\"\n  data-metaKey=\"false\"\n  data-shiftKey=\"false\"\n\u003e\n  \u003cinput type=\"text\" placeholder=\"Press 'ctrl+b' key\" /\u003e\n\u003c/key-down\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzicklepop%2Fkey-down","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzicklepop%2Fkey-down","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzicklepop%2Fkey-down/lists"}