Hacker News new | ask | show | jobs
by DannyBee 905 days ago
It is not putting your mouse itself in absolute mode (only graphics tablets really operate in absolute mouse mode). It's just outputting absolute mode reports to the host.

Absolute mouse HID report has a logical/physical min/max, not just delta. Regardless of size of screen, min/max correspond to the boundaries in absolute mode.

So it's just keeping track internally of the incremental relative accumulation of your mouse as you move it, and i assume, when you hit the min/max, swapping screens.

I assume it's reporting a high enough min/max resolution to make this not happen crappily.

The polling rate on mice is usually only 125hz (8ms), so it has plenty of time to handle the input.

Even "gaming" mice are usually only 1000hz (1ms).

I would guess, looking at it, that it takes a few microseconds to handle the mouse moves, max.

1 comments

As I understand GPIO speed is limited and below usb 2.0 speed if I am not mistaken. So what is the maximum speed of this setup? How ‘gaming” gaming mouse can be?
You are talking transfer rate but these are polling in most cases. The gpio can easily handle 1000hz. It can 66 thousand times that speed in fact. The amount of processing they do is negligible and probably amounts to a few microseconds delay at most.

Even with a non polling mouse there would be no point in reading the result more than a thousand times per second. If you move the mouse 3 inches per second (quite fast) and you only process 1000 reports a second you would still achieve a resolution of 0.003 inches.

From a quick google search (to make sure I'm not just stating my memories, but actual facts) the RP2040 can toggle a GPIO at about 66MHz (via its PIOs. Otherwise a bit slower, and using more CPU). USB 1 is 1.5 or 12Mbps, so you should have no issues even if you bit bang it.

Despite the USB protocol overhead, it is plenty even for a gaming mouse. Pretty sure there's no point polling it at above 1 kilohertz or so.