Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

share|improve this question
6  
Your assumption is not correct. E.g. TCP sockets are somewhat file-like, but do not appear in the file system. –  MSalters Nov 15 '12 at 13:05
1  
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. –  Joachim Sauer Nov 15 '12 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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