Since that every things is a file on the UNIX system. If I have a hardware, for example, a mouse, move from left corner to right corner, it should produce some kinds of file to communicate with the system.

So, if my assumption is correct, is this possible to do following things:

  1. Capture the raw data, which is about moving mouse cursor from left corner to right corner?

  2. Reduplicate the raw data, using a program, same producing speed, and data, in order to "redo" moving mouse cursor from left corner to right corner

  • 6
    Your assumption is not correct. E.g. TCP sockets are somewhat file-like, but do not appear in the file system.
    – MSalters
    Commented Nov 15, 2012 at 13:05
  • 1
    Similar to unix.stackexchange.com/questions/25601/… Commented Nov 15, 2012 at 13:14
  • 1
    Does this need to be on the hardware level? The Xtest extension for X should enable you to replay mouse movement as you wish. Commented Nov 15, 2012 at 13:20

1 Answer 1


Yes you can capture "raw" mouse events using the /dev/input/* device nodes. You can then replay those events by writing an application that interfaces with the uinput driver.

You can also do this with the XServer by subscribing to mouse events on the root window and using the xtest extension to replay the events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.