Mouse is a pointing device which help us point at various objects on the desktop. It evolved from track ball. Earlier mouse had heavy spherical rubber ball and wheel with spokes aligned at 90 degrees which registers the rotation of the ball along x-axis and the y-axis to move the cursor on the screen.
The type of mouse we use these days is an optical mouse. Unlike rubber ball mouse, the optical mouse has a red led which is refracted to the ground (desk) through a prism. The light reflected back from the desk is captured by the light detecting chip (an imaging array of photodiodes) which detected movement of mouse relative to the desk and sends the signal in digital form through the data cable to the computer. The computer processes the data and makes the cursor moves accordingly. Detection of the movement of the mouse relative to the desk is through the Digital signal processor which manipulates the change in the pattern of sequence of image received by it.
Also we have scroll bar. The scroll bar is attached to a circular potentiometer but this potentiometer unlike other do not haul at the ends but allow rotation. The analog is converted to digital form and then sent to the computer through the data cable.
There are micro switches for left click right click and the scroll click.