Roller ball mouse is used from about 1990 to 2000.
You have to clean 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.
Pulling the mouse turns the ball.
X and Y rollers grip the ball and transfer movement.
Optical encoding disks include light holes.
Infrared LEDs shine through the disks.
Sensors gather light pulses to convert to X and Y velocities.
First Mouse, 1968. Douglas Engelbart
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.