The optical mouse was developed by Agilent Technologies and was released in early 2000; these mice, rather then using a ball, use a tiny camera to take around 1,500 pictures every second. (These mice are able to work on almost any surface because of the small, Redlight-Emitting Diode (LED) that bounces light off almost any surface so the camera can detect the surface of E.g., a glass table)
The mouse then sends each picture to a Digital Signal Processor to check if the surface has changed / moved from the last picture. Based on the change in pictures the (DSP) determines how each of the images differ from the last and then works out how far the mouse has moved. The mouse then sends this information to your computer and your computer then moves the mouse! Its quite amazing how fast this works, as the mouse takes hundreds of pictures per second to make this work and appear to move smoothly on your computer!