Re: how computer mouse communicate with 2d screen
The easiest way to learn is to dismantle a mouse and look inside.
There are two basic types, ones with a roller ball that rotates one or both slotted wheels at 90 degree angles to each other and ones that sense the visible image beneath them.
In the ball type, the distance and direction is worked out from the number of 'strobes' from the sensors as the slots break or allow the light beams. They are essentially quadrature encoders so distance and direction can be determined easily. The optical mouse uses a simple camera technique to look at the surface beneath it. They assume the surface is stationary so if the picture appears to move, it means the mouse has been moved in the opposite direction.
When the movement has been reported back to the display device, it adds or subtracts from the last stored cursor coordinates and re-draws it in the new location.
Brian.