Why doesn mouse scrolling work on Linux/Motif?
Mouse scrolling on Linux/Motif relies on the IMWheel driver. Here is how it works: • The X Server gets the wheel event. • Your /etc/X11/XF86Config must contain “ZAxisMap 4 5” (or the equivalent “Option” line if you use XFree86 4.x) in the Mouse section. This maps the wheel to emulated mouse buttons “4” and “5”. • IMWheel has a global hook on the mouse, only looking for button4/5 events. When it sees one, it looks in /etc/X11/imwheel which is a table of what to do for which application. E.g., GTK-based applications support the idea of 5-button mice natively, so the imwheel file says “do nothing (pass through) for gtk”. On the other hand, no known Motif-based app seems to know about these, so imwheel eats the mouse event and emits an accelerator event for “PgUp” or whatever your preference is. It has some clever pre-sets for xterm, netscape, and so on.