Next Previous Contents

4. Using your mouse.

This section deals with the general use of your mouse with various applications.

4.1 Configuring Applications

Most Linux Distributions will prompt you for what type of mouse you have during installation and then setup both gpm and X windows for you. If you do not select the correct mouse protocol or install new mouse hardware you can usually run a command line program that will reconfigure both gpm and X windows to use the new protocol.

Redhat

Under RedHat you can run /usr/sbin/mouseconfig.

Other configurations

Consult your installation documents for what to run under other distributions.

4.2 gpm.

Gpm is a program which allows you to do mouse based 'cut- and-paste' between Linux virtual consoles, much like you can under X, and is a good way of testing your mouse out. The most current version of gpm can be found at ftp://ftp.prosa.it/pub/gpm. Most Linux distributions come with a precompiled gpm binary.

When invoking gpm, use the -t switch to indicate which protocol your mouse is using and the -m option to indicate which mouse device you are using. Three protocols useful for most busmice are logi, bm, and ps2. The default for mouse device is to use /dev/mouse, so you can omit the -m option if you have the appropriate symbolic link. An example for a Microsoft Inport mouse is:

gpm -t bm

or if you use the PS/2 protocol:

gpm -t ps2

You should then be able move your mouse and see a block move around the screen and also be able to cut and paste text between virtual consoles using the mouse buttons. Read the documentation with gpm, or do a ``man gpm'' for more information on how to operate it.

4.3 XFree86.

To use your busmouse under XFree86, you will need to set your mouse protocol type in your Xconfig file. If you have a BusMouse protocol mouse, your Xconfig should contain (including the quotes)


Section "Pointer"
  Protocol "Busmouse"
  Device   "/dev/mouse"
  
  # Any other options such as Emulate3Buttons
EndSection

For PS/2 mice change the protocol line to:


  Protocol        "PS/2"

If you have a two button mouse, it should also contain the line


  Emulate3Buttons

which will allow you to emulate the use of the middle mouse button by pressing both mouse buttons simultaneously. All other mouse related lines, such as ``BaudRate'' and ``SampleRate'' should be commented out, as these have no effect on bus mice.

4.4 XFree86 and gpm.

For a long period of the kernel developement, it was not possible to share busmice between processes. Because of this it was hard to run both XFree86 and gpm at the same time. If you try to run X with gpm running and you get errors like the following then you know you are using one of these older kernels.


Fatal server error:
Cannot open mouse (Device or resource busy)

There are two meathods of getting gpm working with XFree86 with these kernels. The first is to kill any copy of gpm you have running before you start up XFree86. The second is to use gpm's "repeater" option (it takes mouse data and repeats the information to multiple applications).

I would recommend upgrading your kernel if possible so that you can share busmice between processes. For this document, I will only explain the simplest meathod of using XFree86 and gpm together with older kernels. Please see gpm's documentation if you would like to use the repeater meathod.

Gpm allows you to terminate running copies of itself by executing:

gpm -k

This should be done before starting up X11. Take whatever script you use to start up your X session, such as startx, and add the above command to the top of the script so that gpm is shut down automatically. You may wish to also put a command that restarts gpm at the bottom of the script so that it restarts upon exiting your X session.


Next Previous Contents