A Napi library wich provides mouse movement and click events
npm install kepmon
sudo apt-get install libx11-dev libxtst-dev
`
$3
`nodejs
import kepmon from "kepmon"
const position = kepmon.getPointerPosition()
const boundary = kepmon.getPointerBoundary()
const newXPos = boundary.xLimit < position.x + 50 ? 0 : position.x + 50
kepmon.setPointerPosition(newXPos, position.y)
`
For more information check the keepMeOnScript.ts.
$3
In order to extend the system operations you've to do following steps:
First of all you've to install node-gyp.
node-gyp is a tool for building native Addon modules for Node.js, using the same infrastructure as Node itself. With node-gyp, you can compile your C/C++ code into a binary that can be loaded by Node.js and used as if it were any other native module.
#### Prerequisites
Before you can use node-gyp, you need to make sure you have the following installed:
- Node.js and npm
- Python (version 2.x)
- Visual Studio Build Tools (for Windows only) or Xcode (for MacOS only)
- The Windows SDK (for Windows only)
- Installing node-gyp
You can install node-gyp globally with the following command:
Once you have node-gyp installed, you can generate the necessary code with the code below
and than
After that you'll get the pointerService.node file which is used for performing the hardware executions.
So execute now
npm i
in order to install required node modules.
The binding module maps the cpp code through the exposed interface -> see PointerService
and binds it to the generated node` file located in the binary directory.