Getting a wheel mouse to work in
Linux has been the source of much frustration for many users. It's
really a very simple procedure however. There's a few things you need
to keep in mind:
|
Basic Wheel Mouse SetupPerform the following steps as
root:
The ZAxisMapping line activates the wheel as buttons 4 and 5 on the mouse A sample configuration is listed below: |
| Section
"InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/mouse" Option "ZAxisMapping" "4 5" Option "Buttons" "5" |
Advanced Wheel Mouse SetupI've recently acquired a nifty new mouse with 2 wheels and 2 side buttons, for a total of 9 buttons (as recognized by X windows). Sadly, I've only been able to get 7 of the 9 buttons working and to the best of my knowledge, that's the best X-4.2.0 can do. Getting the first wheel operational is simple, and very similar to the basic configuration above. X detects the second wheel, and I use the imwheel program available at freshmeat to give me customized functionality. Perform the following steps as
root:
A Sample configuration is provided
below. This configuration works fine for me:
|
| Section
"InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "ExplorerPS/2" Option "Device" "/dev/mouse" Option "ZAxisMapping" "4 5 6 7" Option "Buttons" "7" |
At this point, your main wheel should provide you with basic scrolling functionality. Your second wheel (or buttons) will apparently seem useless. You can test if they're working by running the xev program. When the program starts, a small white window appears. Move the mouse to that window and click a button. Something similar to the following will be printed out: |
| ButtonPress
event, serial 21, synthetic NO, window 0xe00001, root 0x36, subw 0x0, time 2757505345, (48,100), root:(630,155), state 0x0, button 6, same_screen YES |
The "button 6" in the line above means I clicked the 6th mouse button (scrolling the second wheel forward i.e. the second wheel is working) You now need to get and install the imwheel program available at freshmeat. This program lets you program how your mouse wheels behave, and you can program the wheels to behave differently in different windows!! For instance, I use the second wheel to switch tabs in mozilla, and use the same wheel to scroll through emails in pine. Once imwheel is installed, I start it with the command: imwheel -k -b 0067. This lets my first mouse wheel provide normal scrolling, and lets me program just the second wheel. Read the documentation to find out how to alter this behaviour. Next, modify the /etc/imwheelrc to define how you want your mouse buttons to behave. If the file doesn't exist, you'll find a sample file in the directory where you un-gzipped the imwheel source. The documentation explains how to set up the configuration file. Very briefly, each line looks similar to the following: Shift_L, Left, Control_L|Up
The
first wheel buttons are "Up" and "Down". The second wheel buttons are
"Left" and "Right". You can use the xev program to determine what
codes (keysyms) correspond to what keys.
The line above says "When you hold down the left Shift key on the keyboard and move the second mouse wheel forward, then the key sequence Control-Up is generated" Edit /etc/imwheelrc and you can make your mouse do all sorts of cool things with this program!!! |