August 08, 2003

Mouse and Touchpad Happiness For Linux

Hey! Enki has moved his blog to Armyofevilrobots.com. Check it out after you are done here. This page is going nowhere though...

While I am hopelessly in love with my new (work supplied) Asus Laptop, I am also extremely annoyed by the bad manners exhibited by it's touch pad. I honestly think that these things were designed to only be used by people who hunt and peck. Anybody who tries to type properly inevitably smears their thumbs on the pad, changing/launching windows, and generally makes life hard for themselves.

I was disappointed to find out that X/Linux does not automagically turn of the touchpad when a mouse is plugged in. Lame. The solution? Mouse detection and configuration mangling when X starts.

First thing you have to do is get your XF86Config on. If you already have X working with either mouse,then skip this step, otherwise, change the XF86 lines below...

To get the USB mouse up, enter this command inside of Section "ServerLayout"
        InputDevice    "USB Mouse" "CorePointer"
and then add these lines below the keyboard input device:
#Touchpad
Section "InputDevice"
        Identifier  "Touchpad Mouse"
        Driver      "mouse"
        Option      "Protocol" "Auto"
        Option      "Device" "/dev/mouse"
EndSection
 
# USB-Mouse
Section "InputDevice"
   Identifier      "USB Mouse"
   Driver          "mouse"
   Option          "Protocol" "ExplorerPS/2"
   #Option          "Protocol" "IMPS/2"
   #Option      "Protocol" "Auto"
   Option          "Device" "/dev/input/mouse0"
   Option          "ZAxisMapping" "4 5"
  Option      "Resolution" "1200"
EndSection
Copy this file to XF86Config.nopad in the /etc/X11/ dir.
Now edit the file again and change the line:
        InputDevice    "USB Mouse" "CorePointer"
to read instead:
        InputDevice    "Touchpad Mouse" "CorePointer"
        InputDevice    "USB Mouse" "SendCoreEvents"
Save this file as XF86Config.both in the same directory. Now open your favourite editor and paste in the following script, and save it in your /usr/bin directory...
#!/bin/bash
 if [ -e "/dev/input/mouse0" ]; then
        echo "Found USB mouse. Deactivating pad."
        cp /etc/X11/XF86Config.nopad /etc/X11/XF86Config
else
        echo "No USB mouse. Pad and USB mouse both active."
        echo "Restart X to use mouse only."
        cp /etc/X11/XF86Config.both /etc/X11/XF86Config
fi 
gdm

I know, I know. Ugly hack, but it took all of five minutes, and it works. X will disable the trackpad if you have a USB mouse installed. This does NOT work if you have a second PS/2 mouse. You must also make sure that USB mouse support, and either UHCI or OHCI is active on your computer (already done on RedHat, easy to change in Gentoo).

Note: You may find that your scroll wheel mapping sucks ass. Check this big ass scroll mouse site for more details.

Posted by Enki at August 8, 2003 07:41 PM | TrackBack
Comments

lame? the touchpad and mouse available to me at the same time is priceless.

Posted by: me at June 20, 2004 08:41 PM

Nice site yo got here! I really like it!

Posted by: penis extender at October 13, 2004 08:20 AM

The real question is not whether machines think but whether men do.

Posted by: fleshlight at October 20, 2004 11:15 AM

By recognizing a favorable opinion of yourself, and taking pleasure in it, you in a measure give yourself and your peace of mind into the keeping of another, of whose attitude you can never be certain.

Posted by: vimax at October 22, 2004 01:21 PM

Universal doubt cancels itself.

Posted by: penis pills at October 23, 2004 04:37 AM

The fundamental sense of freedom is freedom from chains, from imprisonment, from enslavement by others. The rest is extension of this sense, or else metaphor.

Posted by: penis enlargement pills at October 26, 2004 07:05 AM

The fundamental sense of freedom is freedom from chains, from imprisonment, from enslavement by others. The rest is extension of this sense, or else metaphor.

Posted by: penis enlargement pills at October 26, 2004 07:46 AM

Happy to read this, that is great guys!

Posted by: gazduire at October 26, 2004 03:18 PM

travel
online gambling
finances
homes
internet
health
shopping
insurance
education
careers
entertainment
business
internet marketing
autos
romance
You guys may find interesting these links.

Posted by: gifts at October 27, 2004 05:03 AM

Money does not pay for anything, never has, never will. It is an economic axiom as old as the hills that goods and services can be paid for only with goods and services.

Posted by: vimax at November 4, 2004 12:57 PM

Thank you for the coments on your website. Can you recomend a good location for me to find cheap medicines? My mama is not well right now. Can you advice? Thank you.

Pablo Villarino

Posted by: Clomid at November 5, 2004 06:16 AM

Hi - I was looking for some information on weight loss. Do you know a good site to visit?

Thanks for your help
Martin Brown

Posted by: athlete zone diet at November 5, 2004 02:14 PM

Reality is just a convenient measure of complexity.
-- Alvy Ray Smith
Home Equity Loan Rate http://www.home-equity-loan-x.com

Posted by: Home Equity Loan Rate at November 16, 2004 06:44 PM
Post a comment









Remember personal info?