{"id":13728698,"url":"https://github.com/colecrouter/wooting-js","last_synced_at":"2026-03-17T09:33:27.096Z","repository":{"id":48406197,"uuid":"389819192","full_name":"colecrouter/wooting-js","owner":"colecrouter","description":"Minimal JavaScript (TypeScript) library using WebHID ","archived":false,"fork":false,"pushed_at":"2022-05-22T21:34:43.000Z","size":55,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:35:06.851Z","etag":null,"topics":["javascript","typescript","wooting-keyboard"],"latest_commit_sha":null,"homepage":"https://mexican-man.github.io/wooting-js/","language":"TypeScript","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/colecrouter.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":"2021-07-27T01:57:07.000Z","updated_at":"2025-01-04T14:13:32.000Z","dependencies_parsed_at":"2022-08-23T21:01:47.094Z","dependency_job_id":null,"html_url":"https://github.com/colecrouter/wooting-js","commit_stats":null,"previous_names":["colecrouter/wooting-js","mexican-man/wooting-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/colecrouter/wooting-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colecrouter%2Fwooting-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colecrouter%2Fwooting-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colecrouter%2Fwooting-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colecrouter%2Fwooting-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colecrouter","download_url":"https://codeload.github.com/colecrouter/wooting-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colecrouter%2Fwooting-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273025827,"owners_count":25032842,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","typescript","wooting-keyboard"],"created_at":"2024-08-03T02:00:48.363Z","updated_at":"2026-03-17T09:33:22.076Z","avatar_url":"https://github.com/colecrouter.png","language":"TypeScript","funding_links":[],"categories":["Libraries"],"sub_categories":["Language Wrappers"],"readme":"# wooting-js\nLightweight JavaScript (TypeScript) library using WebHID. Just for reading analog values, not for RGB.\n\n## Demo\n[Click here](https://mexican-man.github.io/wooting-js/)\n\n## How to use\nFirst you have to make sure the client's [browser supports WebHID](https://caniuse.com/webhid). You can check this like so:\n```js\nif (\"hid\" in navigator) {\n  // Good 👍\n} else {\n  // Bad 💀\n}\n```\n\nInstall the script:\n```bash\nnpm i wooting-js\n```\n\nImport, then trigger the prompt to get a keyboard (has to be user triggered):\n```js\nconst keyboards = await ConnectNew();\n```\n\nSet up a promise waiting for the user to pick their Wooting keyboard:\n```js\nk.then((res) =\u003e {\n  const kb = res[0]\n  // kb is our keyboard!!!\n}).catch((err) =\u003e {\n  // catch error\n});\n```\n\nAnd you're all set! There are two ways to capture user input:\n1. Through a listener\n2. Through the buffer\n\n#### Listener:\n```ts\nkb.device.addEventListener('akeydown', (event) =\u003e {\n  const { key, value } = event.detail;\n  console.log(`${key} key value: ${value}`);\n})\n```\n\n#### Buffer:\n```ts\nimport { AnalogKeyCode } from 'wooting-js';\n\nconst p = kb.buffer[AnalogKeyCode.A];\nconsole.log(`A key value: ${p}`);\n```\n\nUsing a listener gives a smaller footprint, while reading the buffer is a lot more efficient for reading lots of keys. Pick whichever works best for you. In both cases, the value returned is from 0-255. Use `AnalogKeyCode.\u003cinsert-key-name\u003e` to get the id for each key.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolecrouter%2Fwooting-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolecrouter%2Fwooting-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolecrouter%2Fwooting-js/lists"}