I recently had the idea of making similar hardware with ESP32 (some of them has USB hardware). You may lose mouse acceleration, but many do not like this to begin with, so it's fine.
Does absolute mouse work correctly when two systems have very different (total) resolution? For example, one is a laptop with a single screen, and another one is a desktop with three screens.
Absolute mouse "works" in any situation. You are responsible for reporting the physical and logical min/max values for the mouse. The host translates these into screen coordinates.
So if you report the max x/y as 32767, and the current x/y as 32767, the host will translate it to the corner, regardless of size of screen.
How does absolute mouse work? The mouse hw just reports delta x/y and has no idea how the corners of your screen map to your desk surface. So it sounds like special hw. or very frequent recalibration of “corners” after moving mouse when machine is off or lifting+moving (which would essentially be what would happen when using it on machine 2)
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.
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.
Does absolute mouse work correctly when two systems have very different (total) resolution? For example, one is a laptop with a single screen, and another one is a desktop with three screens.