Optical sensing is a technology that allows mouse movement to be detected without the need for moving parts. A miniature optical sensor or digital camera, lit by LED or laser light, repeatedly examines the surface under the mouse and communicates the cursor motion to the host computer.
Depending on the scan rate and the appearance of the surface below the mouse, the sensor cannot always reliably determine the nature of motion; early optical mice were prone to generating random and wildly erratic cursor motion: the cursor would unexpectedly jump to a different part of the screen. Modern mice have all but eliminated these problems and cursor skipping is rare, but still possible with an undesirable surface.
A similar technique is used for optical trackballs: the optical sensor watches the motion of the ball.