Mouse's tale
Mouse's tale
Written by Administrator   
Thursday, 04 February 2010
Article Index
Mouse's tale
Advanced mouse


The interface

As well as the motion detectors the mouse also has some buttons. These are just standard switches and the main argument is about how many a mouse should have.

The standard joke is that a Unix user needs three mouse buttons, a Windows user only two and for a Mac a single button will suffice.

The joke is that the number of buttons is supposed to be related to the IQ of the user! In practice things have moved on beyond these simple comparisons because now we have the "wheely" mouse which has buttons and an additional wheel between the buttons.

The standard interface for a mouse is the PS/2 standard, introduced by IBM as part of its PS/2 (now almost forgotten) range of machines. More modern USB devices are simply upgrades on the basic serial design.

The plug wiring is, for the record:

 2 No connection
 3 GND
 4 +5V
 5 CLK
 6 No connection

Each time the mouse is moved, or the user clicks a button, it sends three bytes of data to the PC. A PS/2 connection works at roughly 1200 baud so that makes it possible for the mouse to send about 40 blocks of data per second.

The problem is that most users want the impossible. They want to be able to point with the mouse accurately – which means big mouse movements should correspond to small screen movements – and they want to point quickly – which means small mouse movements should correspond to large screen movements.

Interestingly it is possible to do the impossible and Apple was the first to work out how. The trick is to vary the sensitivity of the mouse according to how fast it is moved. If you move a mouse slowly then the sensitivity is set to high so that you can position things accurately. If you move a mouse faster then the sensitivity is set low so that the on screen cursor moves a bigger distance. This is the default behaviour in all PC mouse drivers since Windows 3.1 and is still the way the mouse works.

Opto mouse

The ball mouse is simple, cheap and reasonably reliably. It has just one flaw – it gets dirty. As you roll the mouse around the desk the ball picks up bits of yuck that wrap around the rollers and eventually stop it working accurately. The yuck makes the rollers slip against the ball and mean that the cursor moves erratically.


You can see the dirt on the rollers that stopped this mouse in its tracks


As a result people have been in search of the dirtless mouse for many years. The first attempt was the fully optical mouse. This used a pair of LEDs and sensors to detect movement over a specially ruled mouse mat. The electronics simply counted the number of flashes reflected back from the mat. This worked well and didn't get dirty but users didn't like the requirement to use a special mouse mat.



A pure optical mouse needs a special mouse mat


Now we come to the most remarkable part of the story and one that really gives you some idea how far we have come since the first mouse.

The most modern design of mouse is a pure optical mouse that doesn't need a ruled mat. It works by essentially taking photos of your desktop and comparing them to derive movement information. It works by recognising the texture of the surface and working out how far it has moved under the mouse! Every 1/1500th of a second it takes a flash picture of your desktop which is stores in its memory. If the mouse is moved between pictures then this movement will show as differences between the pictures which a digital signal processor chip works out to derive motion vectors giving speed and direction.

This new breed of mouse is reliable, accurate and can work on any surface – with the possible exception of a mirror or a highly polished surface. What is more the response rate is higher than a mechanical or old style optical mouse can manage. All this may well be true but you should pause to think, as you use your new desktop-recognising mouse that it now has more computing power in it than the first PCs that the earlier generations of its kind were built to serve!






The Mod Function

What has modular arithmetic got to do with the real world?
The answer any experienced programmer should give you is "a lot". Not only is it the basis for many an algorithm, it is part of the hardware. [ ... ]

Non-computable numbers

What are the limits to computation? The computer science theory of computation can be intimidating because of its use of logic but taking a programmer's approach makes it seem much simpler. So if you  [ ... ]

Other Articles

Last Updated ( Thursday, 04 February 2016 )

RSS feed of all content
I Programmer - full contents
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.