{"id":17176274,"url":"https://github.com/snosme/uiohook-napi","last_synced_at":"2025-04-04T19:09:40.894Z","repository":{"id":37387585,"uuid":"256858117","full_name":"SnosMe/uiohook-napi","owner":"SnosMe","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-01T04:03:04.000Z","size":60,"stargazers_count":194,"open_issues_count":14,"forks_count":42,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T18:14:03.173Z","etag":null,"topics":["cross-platform","global-hooks","keyboard-events","mouse-events","n-api","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"C","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/SnosMe.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":"2020-04-18T21:38:26.000Z","updated_at":"2025-03-21T01:59:51.000Z","dependencies_parsed_at":"2024-06-18T16:50:30.359Z","dependency_job_id":"948cea94-b6ff-40c7-ac73-4c5d8924ffd5","html_url":"https://github.com/SnosMe/uiohook-napi","commit_stats":{"total_commits":53,"total_committers":4,"mean_commits":13.25,"dds":0.05660377358490565,"last_synced_commit":"52ff6789f51a78cdc2e3551efffb4d30e5d5b932"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnosMe%2Fuiohook-napi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnosMe%2Fuiohook-napi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnosMe%2Fuiohook-napi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnosMe%2Fuiohook-napi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SnosMe","download_url":"https://codeload.github.com/SnosMe/uiohook-napi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"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":["cross-platform","global-hooks","keyboard-events","mouse-events","n-api","nodejs"],"created_at":"2024-10-14T23:59:46.734Z","updated_at":"2025-04-04T19:09:40.872Z","avatar_url":"https://github.com/SnosMe.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uiohook-napi\n\n[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534\u0026label=uiohook-napi\u0026logo=npm\u0026labelColor=212121)](https://www.npmjs.com/package/uiohook-napi)\n\nN-API C-bindings for [libuiohook](https://github.com/kwhat/libuiohook).\n\n\n### Usage example\n\n```typescript\nimport { uIOhook, UiohookKey } from 'uiohook-napi'\n\nuIOhook.on('keydown', (e) =\u003e {\n  if (e.keycode === UiohookKey.Q) {\n    console.log('Hello!')\n  }\n\n  if (e.keycode === UiohookKey.Escape) {\n    process.exit(0)\n  }\n})\n\nuIOhook.start()\n```\n\n### API\n\n```typescript\ninterface UiohookNapi {\n  on(event: 'input', listener: (e: UiohookKeyboardEvent | UiohookMouseEvent | UiohookWheelEvent) =\u003e void): this\n\n  on(event: 'keydown', listener: (e: UiohookKeyboardEvent) =\u003e void): this\n  on(event: 'keyup', listener: (e: UiohookKeyboardEvent) =\u003e void): this\n\n  on(event: 'mousedown', listener: (e: UiohookMouseEvent) =\u003e void): this\n  on(event: 'mouseup', listener: (e: UiohookMouseEvent) =\u003e void): this\n  on(event: 'mousemove', listener: (e: UiohookMouseEvent) =\u003e void): this\n  on(event: 'click', listener: (e: UiohookMouseEvent) =\u003e void): this\n\n  on(event: 'wheel', listener: (e: UiohookWheelEvent) =\u003e void): this\n\n  keyTap(key: keycode, modifiers?: keycode[])\n  keyToggle(key: keycode, toggle: 'down' | 'up')\n}\n\nexport interface UiohookKeyboardEvent {\n  altKey: boolean\n  ctrlKey: boolean\n  metaKey: boolean\n  shiftKey: boolean\n  keycode: number\n}\n\nexport interface UiohookMouseEvent {\n  altKey: boolean\n  ctrlKey: boolean\n  metaKey: boolean\n  shiftKey: boolean\n  x: number\n  y: number\n  button: unknown\n  clicks: number\n}\n\nexport interface UiohookWheelEvent {\n  altKey: boolean\n  ctrlKey: boolean\n  metaKey: boolean\n  shiftKey: boolean\n  x: number\n  y: number\n  clicks: number\n  amount: number\n  direction: WheelDirection\n  rotation: number\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnosme%2Fuiohook-napi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnosme%2Fuiohook-napi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnosme%2Fuiohook-napi/lists"}