{"_id":"@cainier/uiohook-napi","_rev":"3-817a67e391a070e150c13ecd7f139852","name":"@cainier/uiohook-napi","dist-tags":{"latest":"1.5.6"},"versions":{"1.5.4":{"name":"@cainier/uiohook-napi","version":"1.5.4","keywords":["iohook","uiohook","libuiohook","hook","input","keyboard","mouse"],"author":{"name":"Alexander Drozdov"},"license":"MIT","_id":"@cainier/uiohook-napi@1.5.4","maintainers":[{"name":"cainier","email":"xingrong.dev@gmail.com"}],"homepage":"https://github.com/Cainier/uiohook-napi#readme","bugs":{"url":"https://github.com/Cainier/uiohook-napi/issues"},"dist":{"shasum":"4e8c0b4b91f2b958cd7caeccc818145f4831cd97","tarball":"https://registry.npmjs.org/@cainier/uiohook-napi/-/uiohook-napi-1.5.4.tgz","fileCount":9,"integrity":"sha512-HQ9OK/VuLq4ooPCtyquEB31FrnsgOoTQlYzKFwBPnR51ZMJQfEK0wbYeHJcsNQSyvBgTxXoCyt1Hi3WjDQ8LIA==","signatures":[{"sig":"MEUCIQCkGhl15kgXSNdjhhLAjLWBGVW0cczJ4gW6gNceJRuejwIgcFL5BlUhmBp3ZfVVOmk8BNNHTh2g3WvLMgPhoz7UtWs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31491},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">= 16"},"gitHead":"52ff6789f51a78cdc2e3551efffb4d30e5d5b932","gypfile":true,"scripts":{"demo":"ts-node src/demo.ts","install":"node-gyp-build","build-ts":"tsc","prebuild":"prebuildify --napi","make-libuiohook-patch":"git -C ./libuiohook diff --cached > ./src/libuiohook.patch","apply-libuiohook-patch":"git -C ./libuiohook apply ../src/libuiohook.patch"},"_npmUser":{"name":"cainier","email":"xingrong.dev@gmail.com"},"prebuild":{"test":"dist/prebuild-test-noop.js"},"repository":{"url":"git+https://github.com/Cainier/uiohook-napi.git","type":"git"},"_npmVersion":"10.9.2","description":"[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534&label=uiohook-napi&logo=npm&labelColor=212121)](https://www.npmjs.com/package/uiohook-napi)","directories":{},"_nodeVersion":"22.17.0","dependencies":{"node-gyp-build":"4.x.x"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"10.x.x","typescript":"4.x.x","@types/node":"18.x.x","prebuildify":"5.x.x"},"_npmOperationalInternal":{"tmp":"tmp/uiohook-napi_1.5.4_1756873371097_0.7542990708056057","host":"s3://npm-registry-packages-npm-production"}},"1.5.5":{"name":"@cainier/uiohook-napi","version":"1.5.5","keywords":["iohook","uiohook","libuiohook","hook","input","keyboard","mouse"],"author":{"name":"Alexander Drozdov"},"license":"MIT","_id":"@cainier/uiohook-napi@1.5.5","maintainers":[{"name":"cainier","email":"xingrong.dev@gmail.com"}],"homepage":"https://github.com/Cainier/uiohook-napi#readme","bugs":{"url":"https://github.com/Cainier/uiohook-napi/issues"},"dist":{"shasum":"49e14a0379757df2fd20d2aa5f62832d5baa1451","tarball":"https://registry.npmjs.org/@cainier/uiohook-napi/-/uiohook-napi-1.5.5.tgz","fileCount":33,"integrity":"sha512-lzYbaIOEbzbT3TOCnxv8/NwUg7mykPc1R2X1gvSeH2EDSEC6kfqpmm3uEDx2Ut59HqLkCycZE7zQwLH46Ioetw==","signatures":[{"sig":"MEUCIQDxGvSzxW8kjmlmQKZ9vqcfF6q4Cw8nButMp7xFLoLx4QIgTRdqYVkbdiKE481vknL4BWNKrljYTjc1Us5cUDs2uMk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":496182},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">= 16"},"gitHead":"ffd9633179a02825878e7a4186c73a07c785bcfa","gypfile":true,"scripts":{"demo":"ts-node src/demo.ts","install":"node-gyp-build","build-ts":"tsc","prebuild":"prebuildify --napi","prepublishOnly":"npm run fetch-libuiohook && npm run build-ts","prebuild:darwin":"prebuildify --napi --platform darwin --arch x64 && prebuildify --napi --platform darwin --arch arm64","fetch-libuiohook":"bash ./scripts/fetch-libuiohook.sh","make-libuiohook-patch":"git -C ./libuiohook diff --cached > ./src/libuiohook.patch","apply-libuiohook-patch":"git -C ./libuiohook apply ../src/libuiohook.patch"},"_npmUser":{"name":"cainier","email":"xingrong.dev@gmail.com"},"prebuild":{"test":"dist/prebuild-test-noop.js"},"repository":{"url":"git+https://github.com/Cainier/uiohook-napi.git","type":"git"},"_npmVersion":"10.9.2","description":"[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534&label=uiohook-napi&logo=npm&labelColor=212121)](https://www.npmjs.com/package/uiohook-napi)","directories":{},"_nodeVersion":"22.17.0","dependencies":{"node-gyp-build":"4.x.x"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"10.x.x","typescript":"4.x.x","@types/node":"18.x.x","prebuildify":"5.x.x"},"_npmOperationalInternal":{"tmp":"tmp/uiohook-napi_1.5.5_1756874450109_0.8446010870067087","host":"s3://npm-registry-packages-npm-production"}},"1.5.6":{"name":"@cainier/uiohook-napi","version":"1.5.6","author":{"name":"Alexander Drozdov"},"repository":{"type":"git","url":"git+https://github.com/Cainier/uiohook-napi.git"},"license":"MIT","keywords":["iohook","uiohook","libuiohook","hook","input","keyboard","mouse"],"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node-gyp-build","prebuild":"prebuildify --napi","prebuild:darwin":"prebuildify --napi --platform darwin --arch x64 && prebuildify --napi --platform darwin --arch arm64","fetch-libuiohook":"bash ./scripts/fetch-libuiohook.sh","prepublishOnly":"npm run fetch-libuiohook && npm run build-ts","build-ts":"tsc","demo":"ts-node src/demo.ts","make-libuiohook-patch":"git -C ./libuiohook diff --cached > ./src/libuiohook.patch","apply-libuiohook-patch":"git -C ./libuiohook apply ../src/libuiohook.patch"},"devDependencies":{"@types/node":"18.x.x","prebuildify":"5.x.x","ts-node":"10.x.x","typescript":"4.x.x"},"dependencies":{"node-gyp-build":"4.x.x"},"prebuild":{"test":"dist/prebuild-test-noop.js"},"gypfile":true,"engines":{"node":">= 16"},"_id":"@cainier/uiohook-napi@1.5.6","gitHead":"52783b96556dd0d4ed65b33f6ea093ffd028cdd1","description":"[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534&label=uiohook-napi&logo=npm&labelColor=212121)](https://www.npmjs.com/package/uiohook-napi)","bugs":{"url":"https://github.com/Cainier/uiohook-napi/issues"},"homepage":"https://github.com/Cainier/uiohook-napi#readme","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-pYIPdUoGvKv/1wQTKhsULW98ZaNGAwdr1sCQjPTSrKYYV7F/wBOlAs+tZ1dG4XasvBrn27yPVtSbFCDeqLIVbg==","shasum":"9f7681d605797d24b62535b4b77527ef5002dda6","tarball":"https://registry.npmjs.org/@cainier/uiohook-napi/-/uiohook-napi-1.5.6.tgz","fileCount":33,"unpackedSize":495470,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID6Yxst8TQVimn4QvbyhG2yzDMzZnKEc/Kjc/FIXUEkPAiEA05ShhVgXhi5x/Wzey4WXEiZMiAjiDZrQ19HMB13FtzY="}]},"_npmUser":{"name":"cainier","email":"xingrong.dev@gmail.com"},"directories":{},"maintainers":[{"name":"cainier","email":"xingrong.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uiohook-napi_1.5.6_1756875686241_0.9432059343557178"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-03T04:22:51.018Z","modified":"2025-09-03T05:01:26.653Z","1.5.4":"2025-09-03T04:22:51.394Z","1.5.5":"2025-09-03T04:40:50.278Z","1.5.6":"2025-09-03T05:01:26.420Z"},"bugs":{"url":"https://github.com/Cainier/uiohook-napi/issues"},"author":{"name":"Alexander Drozdov"},"license":"MIT","homepage":"https://github.com/Cainier/uiohook-napi#readme","keywords":["iohook","uiohook","libuiohook","hook","input","keyboard","mouse"],"repository":{"type":"git","url":"git+https://github.com/Cainier/uiohook-napi.git"},"description":"[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534&label=uiohook-napi&logo=npm&labelColor=212121)](https://www.npmjs.com/package/uiohook-napi)","maintainers":[{"name":"cainier","email":"xingrong.dev@gmail.com"}],"readme":"# uiohook-napi\n\n[![](https://img.shields.io/npm/v/uiohook-napi/latest?color=CC3534&label=uiohook-napi&logo=npm&labelColor=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) => {\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) => void): this\n\n  on(event: 'keydown', listener: (e: UiohookKeyboardEvent) => void): this\n  on(event: 'keyup', listener: (e: UiohookKeyboardEvent) => void): this\n\n  on(event: 'mousedown', listener: (e: UiohookMouseEvent) => void): this\n  on(event: 'mouseup', listener: (e: UiohookMouseEvent) => void): this\n  on(event: 'mousemove', listener: (e: UiohookMouseEvent) => void): this\n  on(event: 'click', listener: (e: UiohookMouseEvent) => void): this\n\n  on(event: 'wheel', listener: (e: UiohookWheelEvent) => 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","readmeFilename":"README.md"}