Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Configuring xorg.conf for Mice with Scroll Wheels

© Copyright Darrell Anderson.

One of the most widely-asked questions regarding Slackware, and possibly the most common question of all for new Slackware users, is how to configure a two-button mouse with a scroll wheel. When asking the question, many users are told to use the Slackware mouseconfig program to configure the mouse. Unfortunately, the mouseconfig program does not configure the mouse at all, but does little more than establish the proper symbolic link in the /dev devices directory and enable the console-based gpm mouse tool.

The mouseconfig program actually is a shell script and possibly one day, hopefully, this script will be revised to actually configure mice within the xorg.conf configuration file.

The xorgsetup utility might help users configure X, but will not help configure a scroll wheel mouse. Neither will the user-hostile xorgconfig utility. As unpopular as this recommendation might be with Slackware die-hards, grab a copy of the Knoppix CD to configure X. Knoppix is one of the best distros at providing auto-recognition and configuration of hardware. After booting with the Knoppix CD, copy and paste the resulting xorg.conf configuration file.

However, for the impatient, or those people unafraid of exploring text-based configuration files, an easy solution is to edit the xorg.conf manually. Fortunately, editing is not that tough of a chore and requires about a minute of effort.

One tidbit that might help new users is understanding how the X graphical environment sees a two-button mouse with a scroll wheel. The wheel function is considered a button—actually two buttons. Scrolling in the forward direction is considered little more than pressing a button multiple times. Likewise in the reverse direction. Additionally, the wheel itself can be pressed as with the other two conventional buttons. This information means that for all intents and purposes, X sees a two-button mouse with a scroll wheel as a five button mouse.

Another important option for users with mice using PS/2 connectors is to use the IMPS/2 protocol rather than the standard PS/2 protocol.

To configure a two-button mouse with a scroll wheel:

  1. Obtain root privileges.
  2. Use a text editor to open the xorg.conf configuration file. In Slackware that file is located at /etc/X11/xorg.conf.
  3. Search for a section titled Section "InputDevice".
  4. There will be at least two such sections, one for the keyboard and one for the mouse. The distinguishing feature will be an entry titled Identifier "Mouse1" or something similar.
  5. Next edit that section as follows:

    Section "InputDevice"
        Identifier "Mouse1"
        Driver "mouse"
        Option "Protocol"        "IMPS/2"
        Option "Device"          "/dev/psaux"
        Option "Buttons"         "5"
        Option "ZAxisMapping"    "4 5"
        Option "CorePointer"
        Option "SendCoreEvents"  "true"
    EndSection
  6. Save the file.
  7. Restart the X graphical server. For newbies the easiest method might be to reboot. However, if having started X from the command line by using the startx command, then merely exit X and restart X the same way. Another method—but be sure no programs are running other than the X desktop—is to press Ctrl-Alt-Backspace. That keyboard sequence will forcibly restart the X server.

After having restarted the X server, the mouse scroll wheel should be functioning!

Note: the CorePointer directive is useful for laptops to force whether the internal mouse or external mouse will be used as the primary pointing device. The SendCoreEvents is useful to force multiple pointing devices to be recognized concurrently.

Finis.

Table of Contents