Giter VIP home page Giter VIP logo

libxdo's Introduction

libxdo

Node.js wrapper to use libxdo/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

'use strict';

// nvm use lts/*
// node .

//-----------------------------------------------------------------------------
// EXAMPLE IN C   ( gcc -lxdo example.c )
//-----------------------------------------------------------------------------
// #include <xdo.h>
//
// 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

libxdo's People

Contributors

elamperti avatar heinrichad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.