home   articles   archive   forum   masthead  
Published at 29.8.2000
Author: Ronny Ziegler
Translator: Andy Ziegler
Languages: de nl
Printer printer-version
Support Us!

Logitech Wheel-Mouse

Mouse Wheelmice have become more and more popular because they make working with the PC more comfortable, but these products only ship with M$Win drivers -- what do we do?

Drivers? What for?

Logitech Wheel-Mouse An wheel at the top of the mouse offers more degrees of freedom while using the PC.
A short spin of the wheel and you are at the bottom of a document. When in a web browser, you can use it in the same way if and only if the mouse is supported by Linux.
But all mice are only distributed with M$Win drivers, aren't they?
And where do you get drivers for Linux?

You may be surprised, but Linux supports all these mice without any additional drivers as long as they obey the PS/2 standard.

The spin of the wheel creates the same signal as a fourth of fifth mouse button.
Mice with so many buttons have not been in use for a long time, so extensive information about them seems to be lacking.
We don't think that you'll find a Linux distro that supports that many buttons by default. [Mandrake 7.2 and 8.0 does - it even detected and set up our MS Optical Wheelmouse -- and possibly current Red Hat does it as well - ed.]

All you have to do is to configure the X programs and define that the fourth or fifth button (depending on the spin direction of the wheel) corresponds to the correct spin direction of the wheel.
A short setup and you could be ready. But what a surprise, Linux thinks further and the opportunities are bigger than with the distributed drivers for M$Win.
Linux drivers (if you want to call them that) do exist. They can be used in a much more flexible way than just scrolling through text.
How about a setup that the wheel would change the volume if the mouse was over xmms and would change the desktop if the mouse was over gkrellm?
No problem!
You have the freedom to set the function of the wheel, so this way you can reach undiscovered opportunities which are limited by the user's ideas. For example, with a TV card you could use the wheel to switch through all the channels. In combination with a radio mouse, you have the ideal remote control (which would cost about 100 DM). And the joy of spinning through the channels is that big that I wonder why all remote controls don't have a wheel by default.


Before we digress any more, we come back to the basic and dull installation.
First, you have to setup the X server so that the spin of the wheel is interpreted as the push of the fourth or fifth mouse button. This is not set by default as we mentioned above.
Therefore you change the XF86Config which (in general) you find at /etc/X11/ . There you change the setting in the part Pointer

File /etc/X11/XF86Config
  Section "Pointer"
      Protocol    "IMPS/2"
      Device      "/dev/mouse"
      ZAxisMapping    4 5

If you installed XFree86-Version 4.0, the configuration has to look like

File /etc/X11/XF86Config
    Section "InputDevice"
        Identifier "Mouse"
        Driver     "mouse"
        Option "Protocol"        "imps/2"
        Option "Device"          "/dev/psaux"
        Option "ZAxisMapping"    "4 5"
        Option "Buttons"         "3"

After a restart of the X server you would be able to use the wheel if the fourth and fifth button was already preset in the X applications.
But this preset was only done by a few programs like xmms or StarOffice. For a few other programs you can add support by spending a lot of effort in changing the ~/.Xdefaults by hand.


But it can be done much easier.
The already mentioned free button definition of the wheel can be set with the program imwheel, which you find at http://jcatki.dhs.org/ (do not be frightened by the picture you see, the page is the right one). Use the version imwhell.nogpm.
After decompression of the program, you execute (as root):

  >> make
  >> make install
Before you call the program you should end gpm if it was running, because otherwise conflicts could appear:
  >> gpm -q
(It might be that root has to do this if you did not have the proper permissions)
Then you start imwheel:
  >> imwheel
and get the following output:

Output imwheel
  imwheel is not checking/writing a pid file, BE CAREFUL!
  An imwheel may be running already, two or more imwheel processes
  on the same X display, or using gpm -W, will not operate as expected!
  imwheel started (pid=1031)

A view into the list of all running processes using ps should show if imwheel was running.


If imwheel was running you should start with the configuration of the program. A system-wide configuration can be set using the file /etc/imwheelrc. This configuration can be overwritten by every user creating a file ~/.imwheelrc .

Depending on the setting you would like to use, you edit the appropriate file.

An example could be:

   None,		Down,	Control_L|Meta_L|Right
   None,		Up,	Control_L|Meta_L|Left
   #gkrellm can be placed omnipotent on every virtual desktop, thats why 
   #it could be used to change the desktop. (The key combination could be 
   #different for your window manager)
   Alt_L,		Up,	KP_Add
   Alt_L,		Down,	minus
   #If you like, you can zoom into the picture by pressing the ALT-key and
   #spinning the wheel
   None,		Up,	Shift_R|Page_Up
   None,		Down,	Shift_R|Page_Down
   #The wheel is used to move up and down in a terminal
   None,           Up,     Up,	5
   None,           Down,   Down,	5
   #change the volume and scroll through the play list
   None,		Up,	Up
   None,		Down,	Down
   #change channel -- wonderful!
   None,		Up,	Up,	20
   None,		Down,	Down,	20
   #scroll 20 lines
   "XCmail *"
   None,		Up,	Up
   None,		Down,	Down
   None,		Up,	Up,	25
   None,		Down,	Down,	25
   #scroll 25 lines -- nice to read
   None,		Up,	Right
   None,		Down,	Left
   #surf through the Videotex pages
   None, 		Up, Page_Up
   None, 		Down, Page_Down
   #to the next page

The syntax of the configuration file has to be

In the field of the name of the program, wild cards are allowed and an un-specified number of times to execute a key combination set this value to one.

But how do you get the name of a program or a window? This name does not have to be identical with the call to start it.
This "problem" is easily solved. If you spin the wheel up and down on the background of the desktop, you would get a small window:

Imwheel window

In this window, you see a screenshot of the actual desktop. Click on this screenshot and then on the program window of which you want to know the title. The screenshot of the program appears in the imwheel window and at the top-right position the title is shown that you need in your .imwheelrc-configuration.

Program screenshot

The button Reload at the bottom-right would reload the configuration file if you change the file while running the program.

Now you know everything to configure the wheel mouse as you desire.

http://jcatki.dhs.org/The homepage of the imwheel program
http://www.pro-linux.de/t_hardware/logi.html An article about the configuration of imwheel
http://www.64-bit.de/dokumentationen/hardware/005/wheelmouse.html An article from the Linux Magazine about the configuration of imwheel, but they spend too much effort to use a wheel mouse with basic XFree86 (without imwheel)
http://www.inria.fr/koala/colas/mouse-wheel-scroll/ Colas Nahaboo X mouse wheel scroll page. Here you get general information about the usage of a wheel mouse with Linux. You find many more examples for .Xdefaults here, too.

Talkback Area

Enter Own Comment