In addition to the computer keyboard the ‘mouse’ is also an input device. The computer interprets its movement and switch actions. The mouse pointer is moved relative to its current position by a system of pulses generated by movement sensors. The amount of movement in either direction is a result of counting the pulses derived from the slotted disks on the rollers. One simple method of sensing direction is to use two infrared detectors ‘a’ and ‘b’, mouse direction comes from the detected relationship between digital pulses. A pulse at ‘a’ after ‘b’ indicates one direction, similarly a ‘b’ after ‘a’ indicates opposite direction. Output pulses are generated for both actions. A unique sequence of pulses can then be added to the beginning of the pulse train to indicate pointer direction. The output ceases when the mouse is stationary.
The velocity of mouse movement and the number of pulses counted determine mouse pointer speed and screen pointer position. The combined outputs from both sensors (North – South and East – West) will enable the screen pointer to be moved in any direction. To see this, remove your mouse ball and watch the pointer on the screen as you rotate each roller and then both together. In addition to mouse movements, switches generate the familiar ‘click’ and ‘double click’ actions. Inside the CPU each mouse movement generates an ‘interrupt’ (the processor stops what its doing and reads the mouse input port). Think of this the next time you become impatient and try to hurry things along by wiggling the mouse.