How Mouse Works
Roller ball mouse is used from about 1990 to 2000. You have to clearn the ball every half a year or so. It gathers dust and dirt, and can get stuck. It works well on smooth flat surfaces only. It does not work well on carpet.
Optical Mouse and Laser Mouse
Optical mouse and laser mouse work by taking a picture of the surface many times per second, and compare the pictures, to see which way the mouse has moved.