Use Your Mouse Pointer To Send Data

[Ido Gendel] was thinking about new and interesting ways to send data between devices, when he realized that the answer was right in his hand. Literally: he decided to try sending data using the mouse pointer. What he came up with was an interesting hack that uses small movements of the mouse pointer to send data at up to 1200bps, or about 150 bytes per second.

The way he did this was very, very clever. He used an Arduino Leonardo that is set to emulate a mouse, working alongside his existing mouse. This setup means that he can use his existing mouse: the system just sees the Arduino as a second mouse, and the pointer just looks a little jerky when you zoom in. That is because the Arduino is just sending tiny movements, each of which is a code that represents a nybble (4 binary bits) of data. By using both a combination of three left-right or up-down movements, he was able to create 16 movements, each of which can encode 4 bits of data. Each of these encoding movements also returns the mouse to its origin point, so the mouse doesn’t mysteriously scroll off the screen when data is being sent.

The encoding scheme used by [Ido].
The encoding scheme used by [Ido].
On the computer, a custom program detects and decodes this movement, recreating the stream of data. In his example, this is data from a photoresistor, but it could be anything from random data to the contents of a secret file.

Of course, this isn’t a practical way of sending secret data: it only works when the custom program is active, 150 bytes per second is rather slow and enabling mouse acceleration in Windows stops it working because it masks the small movement. But it is an awesome hack that shows how you can send data in ways that you might not first think of. When you are trying to make a device as simple as possible, this is an important lesson to learn.

11 thoughts on “Use Your Mouse Pointer To Send Data

      1. Quite fast if you want too. As USB allows you to specify the poll frequency, and amount of key downs per poll.
        However, putting the poll frequency very high does cause problems. (I noticed problems when I put a poll frequency on 5ms for an USB keyboard+mouse)

        You better use vendor HID requests, as those are not that hard to use, and guarantee not to mess with other applications.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.