Skip to main content

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

Release files for hid-tools 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hid-tools 0.12
File Size Uploaded
hid_tools-0.12.tar.gz 85.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hid-tools 0.12
File Interpreter ABI Platform
hid_tools-0.12-py3-none-any.whl Python 3 none any Details

Total release size: 191.6 kB

Release files / hid_tools-0.12.tar.gz

Download URL hid_tools-0.12.tar.gz
Size 85.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa8df2a6924b378891820e3080957c4b16a5bd4939765e24820e71142250cd89
BLAKE2b-256 checksum
How to use checksums
f6a8efb6a2bb80bfb118fa61f31eef6c22c99c90d2fbd2a6ed91719da7245d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / hid_tools-0.12-py3-none-any.whl

Download URL hid_tools-0.12-py3-none-any.whl
Size 106.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37e56369ac88d0b151f7529a77b53bac2f0dbdc2d0845a5d261b22ff0a524680
BLAKE2b-256 checksum
How to use checksums
640115355c28be151d4fa85e00608b9b9e45c59340bb93f3e7b09315f5c664d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.12 This release

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3.1

2 release files

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page