hid-replay man page

hid-replay — HID Input device replay through uhid.


hid-replay [Options] [FILENAME]


-i, --interactive

interactive mode: This is the default mode. The device is created and the program wait for the user to hit enter. Once the enter key is pressed the whole events sequence in FILENAME is played in real time. Once it is done, the program loops back to the wait of the user keypress on the enter key.

Hit *Ctrl-C* to stop the replay.
-1, --one

one shot mode: the device is created and then the events are replayed once in real time. The process exists at the end of the replay.

-s, --sleep X: sleep
X seconds once the device is created before next step. Useful in conjunction with --one.


hid-replay requires the module uhid to be loaded (present in kernels 3.6+).

If this kernel module is loaded, hid-replay allows the user to create virtual HID devices as if they were physically plugged to the system. Then, the user has the possibility to replay the previously recorded HID events that are therefore handled by the right HID kernel module.

hid-replay needs to be able to write to /dev/uhid; in most cases this means it must be run as root.

hid-recorder and hid-replay are used to debug kernel issues with HID input devices.

Input File

The input file of hid-replay has the following syntax:

Any other starting characters are just ignored.


hid-replay is a very low level events injector. To have the virtual device handled by the right HID kernel module, hid-replay fakes that the device is on the original bus (USB, I2C or BT). Thus, if the kernel module in use has to write back to the device the kernel may oops if the module is trying to direclty talk to the physical layer.

Be sure to use this program with friendly HID modules that rely only on the generic hid callbacks.

Exit Code

hid-replay returns EXIT_FAILURE on error.

See Also



Benjamin Tissoires <benjamin.tissoires@redhat.com>

Referenced By