Answer by
bzzz (16)
It's not magic. An optical mouse has a very simple digital camera that points out of the bottom, next to a led (light emitting diode) light source that illuminates the work surface. The camera captures an image many times per second and your mouse compares them to see when and where it's been moved.