Using a Two Button Mouse

Many mice sold today have only two buttons. Such mice work fine under Windows, but X programs frequently assume that a mouse has three buttons. When presented with a two-button mouse, X uses the left and right buttons as such, but the middle button's functions are inaccessible. If you intend to use a desktop computer under X for any extended period of time, replacing a two-button mouse with a three-button model is worthwhile. Very expensive mice typically sell for only about $50, and even some sub-$20 models come with three buttons.

Sometimes, though, you have no choice but to live with a two-button mouse—for instance, you can't easily replace the built-in touch pad on a laptop computer. (You may be able to supplement the touch pad with an external mouse, though, and this action is quite worthwhile whenever it's practical.) Other times, it may not be worth the bother—for instance, you might intend to use a computer as a server, and will use X very rarely. In such situations, you may need to configure the mouse to support chording—pressing both buttons simultaneously to mimic the effect of pressing the middle button. In order to enable chording, you need to add a line or two to the mouse's InputDevice section in XF86Config:

Option "Emulate3Buttons" Option "Emulate3Timeout" "60"

The first of these lines tells XFree86 to enable the chording feature. The second line sets a timeout value—the amount of slop, in milliseconds, that X tolerates between pressing the two buttons before it declares the button press to be the middle button. In this example, you could press the two buttons as much as 60ms apart and XFree86 will register it as a click of the middle mouse button. If you omit this line, XFree86 assumes a default value of 50.

0 0

Post a comment