Code Monkey home page Code Monkey logo

cpress's Introduction

cpress

cpress was made for simulating keyboard input on Linux systems. It interacts with /dev/uinput and therefore is very low level and X Window System independent. There are Python and Go bindings provided.


Installation and usage

Before installation

Be aware that by default /dev/uinput is writable only for root. You can start cpress as root or, before doing that, change permissions level on uinput:

chmod +0666 /dev/uinput

cpress handles this automatically. If permissions level is not sufficient, it asks for root password and sets modes on its own. If you want avoid permissions changes for some reason, start as root.


C

Installation

See Makefile or more informations. To compile examples, type:

make example

Usage

Before doing anything with cpress, you'll have to call initialize() function. Then feel free to use these:

press_key(KEY_A);
press_combination(3, KEY_C, KEY_D, KEY_E);
hold_key(KEY_LEFTSHIFT);
press_key(KEY_E);
press_key(KEY_E);
release_key(KEY_LEFTSHIFT);

When you're done with cpress, simply call finish().

For more examples, see self-explanatory file examples/example.c.


Python

Installation

Simply run as root:

python2 setup.py install

Usage

Import module with:

from cpress import *

See self-explanatory file examples/example.py for more informations.


Go

Installation

Just use that command:

go get github.com/solusipse/cpress/go

Usage

Import package with:

import "github.com/solusipse/cpress/go"

See self-explanatory file examples/example.go for more informations.


License

See LICENSE.

cpress's People

Contributors

solusipse avatar

Watchers

 avatar  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.