GithubHelp home page GithubHelp logo

imclab / python-uinput Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tuomasjjrasanen/python-uinput

0.0 1.0 0.0 457 KB

Create Linux input device drivers with Python.

Home Page: http://tjjr.fi/sw/python-uinput/

License: GNU General Public License v3.0

python-uinput's Introduction

===============
 Python-uinput
===============

Python-uinput is Python interface to Linux uinput kernel module which
allows attaching userspace device drivers into kernel. In practice,
Python-uinput makes it dead simple to create virtual joysticks,
keyboards and mice for generating arbitrary input events
programmatically.

Author: Tuomas Räsänen <[email protected]>
Homepage: <http://tjjr.fi/sw/python-uinput/>

Usage examples
==============

Generate keyboard clicks:

  import uinput
  
  device = uinput.Device([uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O])
  
  device.emit_click(uinput.KEY_H)
  device.emit_click(uinput.KEY_E)
  device.emit_click(uinput.KEY_L)
  device.emit_click(uinput.KEY_L)
  device.emit_click(uinput.KEY_O)

Move mouse cursor:

  import uinput
  
  device = uinput.Device([uinput.REL_X, uinput.REL_Y,
                          uinput.BTN_LEFT, uinput.BTN_RIGHT])
  
  for i in range(20):
      device.emit(uinput.REL_X, 5)
      device.emit(uinput.REL_Y, 5)

Generate keyboard combinations:

  import uinput
  
  device = uinput.Device([uinput.KEY_LEFTALT, uinput.KEY_TAB])
  
  device.emit_combo([uinput.KEY_LEFTALT, uinput.KEY_TAB])

See examples/ for other kind of example devices (keyboard, joystick).

How to install
==============

Just run the following commands:

  python setup.py build
  python setup.py install

How to report bugs
==================

The bug database is hosted in Launchpad. If you have found a bug or
have an improvement idea you want to share, please report it at
<https://bugs.launchpad.net/python-uinput>. However, to avoid
duplicate bug reports, before reporting, please check if similiar or
identical bug has already been reported. If so, you can still
subscribe to the existing bug to track its progress.

If you are unsure whether the problem you have is due to a bug, you
can always ask questions at
<https://answers.launchpad.net/python-uinput>.

How to contribute
=================

In addition to reporting bugs and improvement suggestions, you are
encouraged to contribute bug-fixes or features. The source code is
maintained in Git and the main repository is hosted at GitHub,
<https://github.com/tuomasjjrasanen/python-uinput/>. The preferred way
to contibute code is to clone the main Git repository and send a
pull-request. Good old patches via email are also accepted.

How to copy
===========

Python-uinput is free (libre) software and licensed under the terms of
GNU Public License version 3 or later. In short, it means that you are
free to copy, modify and redistribute this software as long as you
place the derivative work under a compatible license. See COPYING for
details.

python-uinput's People

Contributors

esamattis avatar fabiand avatar jumplink avatar tuomasjjrasanen 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.