Julien Herbin
Personnal page

USB mouse and PS2/Touchpad with XFree86

By : Julien Herbin Email : julien-www@ecranbleu.org
Don't hesitate to contact me in case you need any information. Please inform me of any mistake I may have done.
Last modified : 2004-11-02

I wrote this Howto because I didn't found much documentation when I tried to get my USB mouse and my Touchpad to work fine together with XFree on my laptop (DELL Latitude C800). So I hope this page will help you in case you meet the same problem :)

This Howto was written for the Debian Linux distribution, because packages management and dependencies is easy and commonplace through the APT command. It doesn't mean that the configuration won't work with another Linux distribution, since packages to install should be the same, but some configuration files may be located in another directories of your filesystem.

My configuration

Here are the version of programs I used to write this howto. Options may differ if you don't have the same versions.
- XFree86 X server 4.2.1
- linux kernel 2.6.1 (http://www.kernel.org)

Hardware :
- Logitech USB Optical mouse
- DELL Latitude C800 Touchpad

Kernel configuration USB Mouse configuration

Installing the packages

First must be log as root to compile a kernel with a new configuration.
cd /usr/src/linux
make menuconfig
Check the following items are checked (* or M).

Device Drivers - <*> Support for USB
- <*>   EHCI HCD or OHCI HCD or UHCI HCD (given the USB Bus of your computer, mine is UHCI HCD)
- <*>   USB Human Interface Device (full HID) support
- [*] HID input layer support
Input device support
 --- Mouse interface
 - (1024) Horizontal screen resolution
 - (768) Vertical screen resolution
- <M> Event interface
- [*] Mice
- <*>  PS/2 mouse

Build your new kernel

make bzImage
make modules modules_install
cp arch/i386/boot/bzImage /where_you_store_your_kernel/your_new_kernel
Reconfigure /etc/lilo.conf if needed.
Next time you bootstrap, your USB mouse driver should be running.

The XF86Config-4 file

Edit the "/etc/X11/XF86Config-4". You should have at least one "Section" => "InputDevice" block configured. Since you have two mice, you should have two (one for each obsiously).

#PS2 mouse
Section "InputDevice"
    Identifier    "PS2 Mouse"
    Driver        "mouse"
    Option        "CorePointer"
    Option        "Device"        "/dev/psaux"
    Option        "Protocol"        "PS/2"
    Option        "Emulate3Buttons"    "true"
    Option        "ZAxisMapping"        "4 5"

#USB mouse
Section "InputDevice"
    Identifier    "USB Mouse"
    Driver        "mouse"
    Option        "SendCoreEvents"    "true"
    Option        "Device"        "/dev/input/mice"
    Option        "Protocol"        "ImPS/2"
    Option        "Emulate3Buttons"    "true"
    Option        "ZAxisMapping"        "4 5"

Section "ServerLayout"
InputDevice "PS2 Mouse"
InputDevice "USB Mouse"
The first device is the primary device (corepointer), and the second one the alternate device (SendCoreEvents => true).

Note : XFree server will not start if the primary device is not present. That's why I set my Touchpad as the main device.

Now, run startx and pray :)

Get more information