Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heinrichad/libxdo
Node.js wrapper: fake keyboard/mouse input, window management, and more using X11’s XTEST extension and other Xlib functions
https://github.com/heinrichad/libxdo
automation desktop keyboard libxdo mouse screen x11 xdotool xlib
Last synced: 3 months ago
JSON representation
Node.js wrapper: fake keyboard/mouse input, window management, and more using X11’s XTEST extension and other Xlib functions
- Host: GitHub
- URL: https://github.com/heinrichad/libxdo
- Owner: HeinrichAD
- License: gpl-3.0
- Created: 2018-09-07T15:50:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-08T11:34:35.000Z (almost 3 years ago)
- Last Synced: 2024-08-10T05:06:52.040Z (6 months ago)
- Topics: automation, desktop, keyboard, libxdo, mouse, screen, x11, xdotool, xlib
- Language: JavaScript
- Homepage: https://github.com/jordansissel/xdotool
- Size: 27.3 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libxdo
Node.js wrapper to use [libxdo/xdotool](https://github.com/jordansissel/xdotool).fake keyboard/mouse input, window management, and more using X11’s XTEST extension and other Xlib functions
## This project is NOT mantained anymore!
This library is still incomplete. Unfortunaly, I don't have time for this project anymore.
**If someone wants to take over the project, I'm happy to give them the appropriate permissions to the repository.**
# Example
```node
'use strict';// nvm use lts/*
// node .//-----------------------------------------------------------------------------
// EXAMPLE IN C ( gcc -lxdo example.c )
//-----------------------------------------------------------------------------
// #include
//
// void main() {
// xdo_t *xdo = xdo_new(NULL);
// //xdo_send_keysequence_window(xdo, CURRENTWINDOW, "Ctrl+Q", 0);
// xdo_enter_text_window(xdo, CURRENTWINDOW, "Hello @!", 500*1000);
// xdo_free(xdo);
// }
//-----------------------------------------------------------------------------//---------------------------------------------------------
// EXAMPLE VERSION 1
//---------------------------------------------------------// const libxdo = require('./libxdo.js');
// let xdo = libxdo.xdo_new(null);
// if (xdo.isNull()) { console.log("Oh no! Couldn't create object!"); return -1; }
// //libxdo.xdo_send_keysequence_window(xdo, libxdo.CURRENTWINDOW, "Ctrl+Q", 0);
// libxdo.xdo_enter_text_window(xdo, libxdo.CURRENTWINDOW, "Hello @!", 500*1000);
// libxdo.xdo_free(xdo);//---------------------------------------------------------
// EXAMPLE VERSION 2 ( a little bit more C feeling )
//---------------------------------------------------------const {
xdo_new,
xdo_enter_text_window,
//xdo_send_keysequence_window,
xdo_free,
CURRENTWINDOW
} = require('libxdo');let xdo = xdo_new(null);
if (xdo.isNull()) { console.log("Oh no! Couldn't create object!"); return -1; }
//xdo_send_keysequence_window(xdo, CURRENTWINDOW, "Ctrl+Q", 0);
xdo_enter_text_window(xdo, CURRENTWINDOW, "Hello @!", 500*1000);
xdo_free(xdo);
```# Contribution and Inspirations
- [https://github.com/jordansissel/xdotool](https://github.com/jordansissel/xdotool)
- [https://github.com/jordansissel/xdotool/blob/master/xdo.h](https://github.com/jordansissel/xdotool/blob/master/xdo.h) <-- sourced from here
- [https://github.com/node-ffi/node-ffi/wiki/Node-FFI-Tutorial#common-usage](https://github.com/node-ffi/node-ffi/wiki/Node-FFI-Tutorial#common-usage)
- [https://stackabuse.com/how-to-create-c-cpp-addons-in-node/](https://stackabuse.com/how-to-create-c-cpp-addons-in-node/)