{"_id":"@akostiv/iohook","_rev":"8-24f0480e6f8dd23bb12f3833a1a2ce1c","name":"@akostiv/iohook","time":{"modified":"2022-04-04T12:31:06.032Z","created":"2018-01-28T11:11:29.437Z","0.1.9":"2018-01-28T11:11:29.437Z","0.1.10":"2018-01-28T11:37:47.018Z"},"maintainers":[{"email":"akostiv262@gmail.com","name":"akostiv"}],"dist-tags":{"latest":"0.1.10"},"versions":{"0.1.10":{"name":"@akostiv/iohook","version":"0.1.10","description":"Node.js global keyboard and mouse hook","main":"index.js","types":"index.d.ts","scripts":{"install":"node install.js || cmake-js build","install-all":"node install.js --all","build":"cmake-js build","deploy":"node build.js","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/akostiv/iohook.git"},"keywords":["hook","electron","nw.js","listener","mousemove","keypress","keyup","global keypress","shortcut"],"author":{"name":"Aloyan Dmitry"},"license":"MIT","bugs":{"url":"https://github.com/WilixLead/iohook/issues"},"homepage":"https://github.com/WilixLead/iohook#readme","dependencies":{"nan":"^2.6.2","@types/node":"^7.0.39","bindings":"^1.2.1","node-abi":"^2.0.0","pump":"^1.0.2","simple-get":"^2.4.0","tar-fs":"^1.15.2"},"devDependencies":{"cmake-js":"^3.4.1","mkdirp":"^0.5.1","prebuild":"^6.1.0","tar-stream":"^1.5.2"},"gitHead":"5be85ab4950cae44f030af8e841e32d1fcd5df44","_id":"@akostiv/iohook@0.1.10","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"akostiv","email":"akostiv262@gmail.com"},"dist":{"integrity":"sha512-U+/UCZXOtIlZkneOBJOGmuXapFnVX67YNPX1G5NcYvgVV9MvuLL6g1xqdMWlUZ5c26NfDoOrP0BHtbgts1ww3g==","shasum":"ceb20878459acb4c5b2a5df5842aa380d8abc3ec","tarball":"https://registry.npmjs.org/@akostiv/iohook/-/iohook-0.1.10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRiaZaySsfFQYUa2DYH3sUOpdjW6VFl8JYVcF//asqnAIhAPZa+NM0YgBfXmpsTjLHb7x73xewMuRdZrdnzriwk6DX"}]},"maintainers":[{"email":"akostiv262@gmail.com","name":"akostiv"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iohook-0.1.10.tgz_1517139466939_0.1752860527485609"}}},"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/ph54iicf29ipy8wm?svg=true)](https://ci.appveyor.com/project/WilixLead/iohook)\n[![Build Status](https://travis-ci.org/WilixLead/iohook.svg?branch=master)](https://travis-ci.org/WilixLead/iohook)\n\n# iohook\nNode.js global native keyboard and mouse listener.  \nThis module can handle keyboard and mouse events via native hooks.  \n\nIf you like this module or are interested in updates, follow me on Twitter [https://twitter.com/wilixlead](https://twitter.com/wilixlead)\n\n## OS Support\nAlready tested in:\n- Ubuntu 16.04\n- macOS High Sierra 10.13.1\n- Windows 7 SP1\n\n## Installation\nThis module use native library libuiohook and require some installed packages.  \nI really hope find way for use build systems for online build or download prebuild packages.\n\n`npm i git+https://github.com:renjfk/iohook.git`\n\n### Electron users [optional]\nBefore install this module, you need specify build runtime.\nJust add following to your package.json file\n(if you use two-package-json structure, add to app's package.json, not to build).  \nCheckout your ABI for [node.js](https://nodejs.org/en/download/releases/) or [electron](https://www.npmjs.com/package/electron-abi)\n```json\n\"iohook\": {\n  \"targets\": [\n    \"node-51\",\n    \"electron-53\"\n  ],\n  \"platforms\": [\n    \"win32\",\n    \"darwin\",\n    \"linux\"\n  ],\n  \"arches\": [\n    \"x64\",\n    \"ia32\"\n  ]\n}\n```\n**NOTE: Please remember, when you install iohook, it try to use current node environment NOT ELECTRON OR NW.js**\n\n### Prebuild support  \niohook support prebuilded binaries for next environment versions:  \n- electron:\n  - [47] 1.0.2\n  - [48] 1.2.8\n  - [49] 1.3.13\n  - [50] 1.4.15\n  - [51] 1.5.0\n  - [53] 1.6.0\n\n- node:\n  - [46] 4.6.1\n  - [47] 5.12.0\n  - [48] 6.9.4\n  - [51] 7.4.0\n\nSupport for node.js v0.12, io.js, nw.js is planed.\n\n## Manual compilation for your version of environment  \niohook have prebuild binaries, it downloads when you try to install it.  \nBut if you use specified version of node.js/nw.js/io.js/electron/etc. you can try compile it.  \nAll what you need install os dependencies and start compilation:\n\n### Ubuntu 16\n- `sudo apt install libx11-dev libxtst-dev libxt-dev libx11-xcb-dev`\n- `sudo apt install libxkbcommon-dev libxkbcommon-x11-dev`\n- `cd node_modules/iohook`\n- `npm run build`\n\n### macOS\n- `brew install cmake automake libtool pkg-config`\n- `cd node_modules/iohook`\n- `npm run build`\n\n### Windows\n- for Node.js usage just make sure that you have installed following components and it will be built by install script\n  - [![](https://cmake.org/wp-content/uploads/2014/06/favicon.png) CMake](https://cmake.org)\n  - [![](http://landinghub.visualstudio.com/favicon.ico) Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)\n  - [CMake.js](https://www.npmjs.com/package/cmake-js)\n- for Electron go to installation dir (node_modules/iohook) and recompile it according to your Electron version. e.g. `cmake-js rebuild -r electron -v 1.7.1`\n\n## Usage\nModule is pretty simple for use. There is example:  \n\n```javascript\n'use strict';\nconst ioHook = require('iohook');\n\nioHook.on(\"mousemove\", event => {\n  console.log(event);\n  /* You get object like this\n    {\n      type: 'mousemove',\n      x: 700,\n      y: 400\n    }\n   */\n});\n\n//Register and start hook\nioHook.start();\n```\nIf type ```ioHook.start(true);``` you can enable debug logger in native lib. Use it if you have troubles with this module\n\n\n### Available events\n\n### keypress (NOT WORKING AT THIS MOMENT, USE keydown/keyup)\nCalls when user press and release a key. Event contain next object:  \n`{keychar: 'f', keycode: 19, rawcode: 15, type: 'keypress'}`\n\n### keydown\nCalls when user press a key. Event contain next object:  \n`{ keychar: 'd', keycode: 46, rawcode: 8, type: 'keydown' }`\n\n### keyup\nCalls when user release a key. Event contain next object:  \n`{keychar: 'f', keycode: 19, rawcode: 15, type: 'keup'}`\n\n### mouseclick\nCalls when user click mouse button. Event contain next object:  \n`{ button: 1, clicks: 1, x: 545, y: 696, type: 'mouseclick' }`\n\n### mousedown\nCalls when user press and release a key. Event contain next object:  \n`{ button: 1, clicks: 1, x: 545, y: 696, type: 'mousedown' }`\n\n### mouseup\nCalls when user press and release a key. Event contain next object:  \n`{ button: 1, clicks: 1, x: 545, y: 696, type: 'mouseup' }`\n\n### mousemove\nCalls when user press and release a key. Event contain next object:  \n`{ button: 0, clicks: 0, x: 521, y: 737, type: 'mousemove' }`\n\n### mousedrag\nCalls when user press and release a key. Event contain next object:  \n`{ button: 0, clicks: 0, x: 373, y: 683, type: 'mousedrag' }`\n\n### mousewheel\nCalls when user press and release a key. Event contain next object:  \n`{ amount: 3, clicks: 1, direction: 3, rotation: 1, type: 'mousewheel', x: 466, y: 683 }`\n\n## Known issues\nIn some cases, most often when you make mouse moves or keyboard events very fast,\nmodule crash with \"Segmentation fault: 11\". Looks like it is problem in my native implementation,\nbut I still can't find a problem. Will be happy if somebody helps with it.\n\n## Credits\nThanks for [libuiohook](https://github.com/kwhat/libuiohook) project!    \nThank you [ayoubserti](https://github.com/ayoubserti) for first iohook prototype  \nThank you [vespakoen](https://github.com/vespakoen) for prebuild system implementation\n","readmeFilename":"README.md","description":"Node.js global keyboard and mouse hook","homepage":"https://github.com/WilixLead/iohook#readme","keywords":["hook","electron","nw.js","listener","mousemove","keypress","keyup","global keypress","shortcut"],"repository":{"type":"git","url":"git+https://github.com/akostiv/iohook.git"},"author":{"name":"Aloyan Dmitry"},"bugs":{"url":"https://github.com/WilixLead/iohook/issues"},"license":"MIT"}