{"id":26896007,"url":"https://github.com/ashubham/w3c-keys","last_synced_at":"2025-05-12T20:18:20.988Z","repository":{"id":37612030,"uuid":"98502516","full_name":"ashubham/w3c-keys","owner":"ashubham","description":"keyboardEvent.key compatible key codes with Typescript Definitions.","archived":false,"fork":false,"pushed_at":"2021-01-29T03:40:08.000Z","size":58,"stargazers_count":55,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T02:59:18.755Z","etag":null,"topics":["html5","keyboard-events","typescript","w3c"],"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/ashubham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-27T06:41:31.000Z","updated_at":"2024-09-16T18:53:58.000Z","dependencies_parsed_at":"2022-08-19T02:01:14.673Z","dependency_job_id":null,"html_url":"https://github.com/ashubham/w3c-keys","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashubham%2Fw3c-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashubham%2Fw3c-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashubham%2Fw3c-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashubham%2Fw3c-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashubham","download_url":"https://codeload.github.com/ashubham/w3c-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253815029,"owners_count":21968563,"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":["html5","keyboard-events","typescript","w3c"],"created_at":"2025-04-01T02:59:23.287Z","updated_at":"2025-05-12T20:18:20.968Z","avatar_url":"https://github.com/ashubham.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# w3c-keys\n[![Build Status](https://travis-ci.org/ashubham/w3c-keys.svg?branch=master)](https://travis-ci.org/ashubham/w3c-keys)\n[![npm version](https://badge.fury.io/js/w3c-keys.svg)](https://badge.fury.io/js/w3c-keys)\n[![npm](https://img.shields.io/npm/dm/w3c-keys.svg)](https://www.npmjs.com/package/w3c-keys)\n\n\u003cimg src=\"https://github.com/ashubham/w3c-keys/raw/master/assets/keys.jpg\" align=\"right\" alt=\"w3c-keys\" /\u003e\n\nkeyboardEvent.key compatible key codes with Typescript Definitions.\n\nRead https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n\nCompatible with IE/Edge/Safari Key idiosyncrasies.\n\nSuper Lightweight: ~900 Bytes Gzipped (Potentially smaller when combined gzipped with a bigger app)\n\n## Usage\n\n```typescript\nimport { Key } from 'w3c-keys';\n\n// To dispatch Events.\nlet evt = new KeyboardEvent('keydown', {\n    key: Key.Space\n});\ndocument.body.dispatchEvent(evt);\n\n// To check event keys.\ndocument.body.on('keydown', (e) =\u003e {\n    if(e.key === Key.Backspace) {\n        // Do some shiz...\n    }\n});\n```\n\n## Why not use evt.which keyCodes ?\n\n- `evt.which` keycodes are a deprecated standard.\n- Ability to create synthetic key events is not possible with `evt.which`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashubham%2Fw3c-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashubham%2Fw3c-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashubham%2Fw3c-keys/lists"}