Mouse swapping on a laptop
Bill Mullen
moon at lunarhub.com
Sat Aug 2 05:08:25 EDT 2003
Dan Coutu said:
> My laptop has a touchpad mouse built-in and that works fine with my
> mouse setting as a generic 2-button ps/2 mouse. I have a Logitech
> wireless wheel mouse that I attach to it when working with it on the
> desktop. I do use the touchpad when take the computer elsewhere, no
> point in dragging around a load of hardware.
>
> What I'm trying to determine is whether or not there's a way to enable
> use of the wheel on the cordless mouse without making a mess of the
> mouse behavior when it is not plugged in.
I'd suggest creating two "InputDevice" sections in your XF86Config-4 file,
one for each pointer, and two corresponding "ServerLayout" sections. You
can then start X with the first ServerLayout by default, and specify the
second explicitly on those occasions when you need it. Which is which
depends on which configuration you use more frequently.
Let's say, for example, that you want the wheel mouse to be the default.
The InputDevice sections would look like:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/psaux"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "on"
EndSection
The ServerLayout sections would look like:
Section "ServerLayout"
Identifier "layout1"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Mouse1" "CorePointer"
Screen "screen1"
EndSection
Section "ServerLayout"
Identifier "layout2"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Mouse2" "CorePointer"
Screen "screen1"
EndSection
When home (where the mouse is connected), you would start X in whatever
fashion you routinely do now, and "layout1" will be used, because it is
the first one encountered in the XF86Config-4 file.
When traveling (without the mouse), you would start X from a console
rather than from a display manager, with a command line like:
startx -- -layout layout2
HTH!
--
Bill Mullen moon at lunarhub.com MA, USA RLU #270075 MDK 8.1 & 9.0
"Giving money and power to the government is like giving whiskey and
car keys to teenage boys." - P.J. O'Rourke
More information about the gnhlug-discuss
mailing list