Wheel mice are great, but until recently I thought there were for Windows Exclusivly. Well, no more. I bought a Logitech Pilot Mouse+ for my Linux box, as I was tired of switching from Microsoft to MouseSystems mode when switching from OS to OS, and because Logitech employ quite a lot of people in my home town too. I will say right now that there arent many applications that can make full use of the mouse, but then again, who needs most of them to do it. The ones that I am using right now with the mouse include Netscape, rxvt (Wheel enables the buffer scrollback), and Tkrat (Or indeed an Tk application). For the mouse to function, we need to first tell XWindows that we got a new mouse on the system. You do remember how to run an xf86config, right? Well, fire that up and specify Microsoft Intellimouse, even if your using one by a different manufacturer, they all use the same protocol. Finish the xf86config as normal, and boot to X.
The next thing to do is to tell X that this wheel mouse has not three, but 5 buttons. But where are 4 and 5? They dont exist, but neither does the wheel forward event. XWindows treats moving the wheel forward as if you had pressed button 4 repeatedly, and similarly for moving the wheel back. To do this, you have to find xf86config. On a RH system, this is located here ... /usr/X11R6/lib/X11/XF86Config ... so vi it. In the editor, go to the Pointers section, its quite well labelled. Just before it says "EndSection" put this on a line of its own - ZAxisMapping 4 5
Save and exit ... kill X, logout, and log back in. You've just told XWindows how to behave if the wheel is scrolled. This is well and good, but now X doesnt have a clue about what to do with the wheel, this is where a bit of playing comes in. In your /root/ directory, there is a file called .Xdefaults, the . at the start of that is important. Vi this file, and paste the following text into it :
!## NETSCAPE
Netscape*drawingArea.translations: #replace \
<Btn1Down>: ArmLink() \n\
<Btn2Down>: ArmLink() \n\
~Shift<Btn1Up>: ActivateLink() \n\
~Shift<Btn2Up>: ActivateLink(new-window) \
DisarmLink() \n\
Shift<Btn1Up>: ActivateLink(save-only) \
DisarmLink() \n\
Shift<Btn2Up>: ActivateLink(save-only) \
DisarmLink() \n\
<Btn1Motion>: DisarmLinkIfMoved() \n\
<Btn2Motion>: DisarmLinkIfMoved() \n\
<Btn3Motion>: DisarmLinkIfMoved() \n\
<Motion>: DescribeLink() \n\
<Btn3Down>: xfeDoPopup() \n\
<Btn3Up>: ActivatePopup() \n\
Ctrl<Btn4Down>: PageUp()\n\
Ctrl<Btn5Down>: PageDown()\n\
Shift<Btn4Down>: LineUp()\n\
Shift<Btn5Down>: LineDown()\n\
None<Btn4Down>: LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
None<Btn5Down>: LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
Alt<Btn4Down>: xfeDoCommand(forward)\n\
Alt<Btn5Down>: xfeDoCommand(back)\n
Netscape*globalNonTextTranslations: #override\n\
Shift<Btn4Down>: LineUp()\n\
Shift<Btn5Down>: LineDown()\n\
None<Btn4Down>:LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
None<Btn5Down>:LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
Alt<Btn4Down>: xfeDoCommand(forward)\n\
Alt<Btn5Down>: xfeDoCommand(back)\n
Save and exit, kill X, logout, log back in and restart X. That will get Netscape working, but no other app. If you wish to use a wheel mouse to control rxvt's buffer, then all you need to do is download the latest version of rxvt, you'll need version 2.4.6 at least, and besides, with that version you can use xpm files as colored backdrops for your rxvt's anyway.
That should at least get the mouse working, and when GTK supports it, I'll add info to this file on it. The GTK patch is in progress but the code is progressing.
Click here to return to the BLG
|