You can either write a Linux device driver to interpret your data as a real mouse, or you can convince the X server (or something else) to accept input from something else, such as a named pipe.
Actual device files are not files with any content - they are just links to the primary and secondary numbers used to talk with the driver in the kernel, which can work with some file parameters on any device. You create device files with mknod, but they will not work until they are supported by the kernel driver with the corresponding numbers. Believe me, now there are some stub mechanisms, so the bulk of the actual driver can work in user space.
Chris stratton
source share