Tuesday, January 10, 2006

USB mouse on laptop

I noticed that if I boot up to Linux on my laptop, and then plug in the mouse, I never got it to work. That's because the X server needed to be tweaked.

First thing is to make sure you have the hotplug service running. Next, add these lines to /etc/X11/xorg.conf:

Section "InputDevice"
    Identifier "USBMouse"
    Driver "mouse"
    Option "Protocol" "IMPS/2"<     Option "Device" "/dev/mouse"
    Option "ZAxisMapping" "4 5"
EndSection

Then at the bottom in the ServerLayout section, change it to look similar:

Section "ServerLayout"
    Identifier "layout1"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "USBMouse" "SendCoreEvents"
    InputDevice "Touchpad" "AlwaysCore"
    Screen "screen1"
EndSection

The touchpad is always present, and thus, has the setting AlwaysCore. The USB mouse will be sent the core events, and thus enabling it to be used if it is plugged in. Once you have made these changes, save the xorg.conf, and restart X with Ctrl-Alt-Backspace. That's all!

No comments: