Skip to main content

HID tools

Project description

hid-tools is a set of tools to interact with the kernel's HID subsystem.

It can be run directly from the git repository or installed via pip3 install hid-tools.

Installation

The hid-tools repository does not need to be installed, all tools and kernel tests can be run straight from the git repository, for example the following commands clone the repository and run the hid-recorder tool.

$ git clone https://gitlab.freedesktop.org/libevdev/hid-tools
$ cd hid-tools
$ sudo ./hid-recorder

Where the tools need to be installed, it is recommended to use pip:

$ sudo pip3 install .

This installs all tools into the system-wide Python path. hid-tools needs root access to the /dev/hidraw nodes, an installation in the user-specific paths will not usually work without further commandline tweaking configuration. Removal of the tools works with pip as well:

$ pip3 uninstall hid-tools

Debugging tools for users

hid-recorder

hid-recorder prints the HID Report Descriptor from a /dev/hidraw device node and any HID reports coming from that device. The output format can be used with hid-replay for debugging. When run without any arguments, the tool prints a list of available devices.

$ sudo hid-recorder

hid-replay

hid-replay takes the output from hid-recorder and replays it through a virtual HID device that looks exactly like the one recorded. hid-replay requires UHID support so make sure pyudev is installed.

$ sudo hid-replay recording-file.hid

hid-decode

hid-decode takes a HID Report Descriptor and prints a human-readable version of it. hid-decode takes binary report descriptors, strings of bytes, and other formats.

$ hid-decode /sys/class/input/event5/device/device/report_descriptor

kernel tests

The hid-tools repository contains a number of tests exercising the kernel HID subsystem. The tests are not part of the pip3 module and must be run from the git repository. The most convenient invocation of the tests is by simply calling pytest. The test suite requires UHID support so make sure pyudev is installed.

$ git clone https://gitlab.freedesktop.org/libevdev/hid-tools
$ cd hid-tools

Note If your testing system is running X, please follow the steps below to let X drivers ignore uhid test devices. Otherwise, the X driver will recognize and handle the test devices, which would interfere with the kernel tests and the running session.

$ sudo cp tests/91-hid-tools-uhid-test.conf /etc/X11/xorg.conf.d/

Restart your X server End of Note

$ sudo pytest-3

See the pytest documentation for information on how to run a subset of tests.

hidtools python module

Technical limitations require that hid-tools ships with a Python module called hidtools. This module is not to be used by external applications.

The hidtools python module does not provide any API stability guarantee. It may change at any time

License

hid-tools is licensed under the GPLv2+.

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

hid_tools-0.8.tar.gz (85.7 kB view details)

Uploaded Source

Built Distribution

hid_tools-0.8-py3-none-any.whl (106.5 kB view details)

Uploaded Python 3

File details

Details for the file hid_tools-0.8.tar.gz.

File metadata

  • Download URL: hid_tools-0.8.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.2

File hashes

Hashes for hid_tools-0.8.tar.gz
Algorithm Hash digest
SHA256 633e16e5578e1ab9f47f1865283a354c3e8ec2029add9c911323f486a0333534
MD5 82047f769c7e8cffdecb5254bf8a8e33
BLAKE2b-256 5546601edf20c260a2de3808e7e319e5799b0b169c88ee37660dc45a67853812

See more details on using hashes here.

File details

Details for the file hid_tools-0.8-py3-none-any.whl.

File metadata

  • Download URL: hid_tools-0.8-py3-none-any.whl
  • Upload date:
  • Size: 106.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.2

File hashes

Hashes for hid_tools-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 82d6e2ca6957ef77d094f040fcb3c432d083bd03381ba772c89707c524f20b9b
MD5 36d5cdd198b20b45b716100ac239abb6
BLAKE2b-256 aeb65d75aa674536ce32864d7cf503a1bf77f3da370613845299a8fc0cb9278f

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