Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

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.


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


Latest stable version from PyPI.

$ pip install xinput

Latest stable version from bitbucket.

$ pip install -e hg+

Latest stable version from github.

$ pip install -e git+

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.


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


>>> 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)


GPL 2.0/LGPL 2.1


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


Artur Barseghyan <>

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
xinput-0.1.3.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None Aug 29, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page