Skip to main content

Enable/disable xinput devices from terminal or using the API.

Project description

Enable/disable xinput devices (for example, a touchpad) from terminal or using the API.

Prerequisites

  • Python 2.6.8+, 2.7.+, 3.3.+

Installation

Latest stable version from PyPI.

$ pip install xinput

Latest stable version from bitbucket.

$ pip install -e hg+https://bitbucket.org/barseghyanartur/xinput@stable#egg=xinput

Latest stable version from github.

$ pip install -e git+https://github.com/barseghyanartur/xinput@stable#egg=xinput

Usage examples

First argument represents device state (0 for disable and 1 for enable). Second argument represents device name.

By default we operate with Synaptics TouchPad but it’s possible to have custom device names.

After installation you should be able to disable/enable touchpad by typing “disable-touchpad” or “enable-touchpad” commands in your terminal.

Command-line

To enable Synaptics TouchPad, type in terminal:

$ xinput-manage 1 Synaptic TouchPad

To disable Genius Optical Mouse, type in terminal:

$ xinput-manage 0 Genius Optical Mouse

There are also shortcuts for enabling/disabling the touchpad.

Type the following in terminal to disable the touchpad:

$ disable-touchpad

Type the following in terminal to enable the touchpad:

$ enable-touchpad

Programmatically

>>> from xinput import operate_xinput_device, MODE_ENABLE, DEVICE_NAME_SYNAPTIC, MODE_DISABLE
>>> operate_xinput_device(MODE_DISABLE, DEVICE_NAME_SYNAPTIC)
>>> operate_xinput_device(MODE_ENABLE, DEVICE_NAME_SYNAPTIC)

License

GPL 2.0/LGPL 2.1

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xinput-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file xinput-0.1.1.tar.gz.

File metadata

  • Download URL: xinput-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xinput-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3f0ef86dbc3ca3d41b0be911d0dd57502f4e2b79ebbb6f4de59f551db8ca1972
MD5 2d1149d366c654c099fb00084b5c58cb
BLAKE2b-256 9ad9543f8280297a2eed3aa3a12957554526bbd38327942afd460031a20f1b1c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page