https://github.com/ahmetcavus/kepmon
Kepmon is a napi module providing pointer access and control.
https://github.com/ahmetcavus/kepmon
events keyboard mouse napi system
Last synced: about 2 months ago
JSON representation
Kepmon is a napi module providing pointer access and control.
- Host: GitHub
- URL: https://github.com/ahmetcavus/kepmon
- Owner: AhmetCavus
- License: mit
- Created: 2023-02-06T21:40:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-26T16:10:40.000Z (4 months ago)
- Last Synced: 2025-03-30T04:43:31.225Z (3 months ago)
- Topics: events, keyboard, mouse, napi, system
- Language: C++
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kepmon
Kepmon is a [napi module](https://www.npmjs.com/package/node-addon-api) providing pointer access and control.
In the earliest version Windows and Linux OS is supported! But you can also try it on macOS.
## Getting Started
### Linux
In order to use the library in Ubuntu (maybe other variations can also work but it's not tested) you've to install
```
sudo apt-get install libx11-dev libxtst-dev
```### Usage
```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](./src/keepMeOnScript.ts).### Extending the library
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-gypYou can install node-gyp globally with the following command:
`
npm install -g node-gyp
`Once you have node-gyp installed, you can generate the necessary code with the code below
`
node-gyp configure
node-gyp build
`and than
`
node-gyp rebuild
`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](node_modules/bindings/README.md) module maps the cpp code through the exposed interface -> see [PointerService](src/pointer/pointerService.ts)
and binds it to the generated `node` file located in the binary directory.For further instruction on how to use node-gyp and napi properly you can follow the (documentation)[https://nodejs.org/api/n-api.html]
Feel free to make any suggestions or creating pull requests in order to provide a multi-platform support or further extensions.
## License
See the [LICENSE](./LICENSE) file for licensing information.