[ltp] PS/2 Wheel Mouse

André Wyrwa linux-thinkpad@linux-thinkpad.org
Mon, 12 Apr 2004 21:38:53 +0200


Hei,

> The Trackpoint and the PS/2 mouse port share data lines on Thinkpads.  
> The Trackpoint uses the PS/2 protocol, while most wheelmice use the 
> IMPS/2 protocol.  If you have 2 devices that speak different protocols 
> sharing the same data lines, it's highly likely that neither one will 
> work.  One thing that will work is to disable the Trackpoint using the 
> BIOS Setup or ntpctl, then make sure the mouse protocol for the PS/2 
> port in your /etc/X11/XF86Config is set to "IMPS/2" and the Option 
> "ZAxisMapping" "4 5" line is present for your mouse.

I totally agree...here's what i do:

--- XF86Config-Snippet ---

Section "ServerFlags"
#       Option  "Xinerama"      "true"
        Option  "DefaultServerLayout" "Dualhead Trackpoint"
EndSection

Section "ServerLayout"
        Identifier     "Singlehead Trackpoint"
        Screen         "Screen0"
#       Screen             "Screen1" RightOf "Screen0"
#       InputDevice    "Mouse0" "CorePointer"
        InputDevice             "Trackpoint" "CorePointer"
        InputDevice             "cursor" "SendCoreEvents"
        InputDevice             "stylus" "SendCoreEvents"
        InputDevice             "eraser" "SendCoreEvents"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "ServerLayout"
        Identifier     "Singlehead Mouse"
        Screen         "Screen0"
#       Screen             "Screen1" RightOf "Screen0"
        InputDevice    "Mouse0" "CorePointer"
#       InputDevice             "Trackpoint" "CorePointer"
        InputDevice             "cursor" "SendCoreEvents"
        InputDevice             "stylus" "SendCoreEvents"
        InputDevice             "eraser" "SendCoreEvents"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

...

Section "InputDevice"
        Identifier      "Trackpoint"
        Driver          "mouse"
        Option          "Protocol" "PS/2"
        Option          "Device" "/dev/mouse"
        Option          "Emulate3Buttons" "yes"
    Option      "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "imPS/2"
        Option      "Device" "/dev/mouse"
   Option      "Emulate3Buttons" "no"
   Option      "ZAxisMapping" "4 5"
EndSection

...

--- script to probe for mouse ---

#!/bin/sh
# check for presence of an external ps2 mouse
# so far works on thinkpads only since it uses tpctl

echo "launching ps2mouse tester"

if [ `tpctl --spe | grep "activation mode" | cut -c55-60` == "enable" ]
then
  echo "HWPROF_PS2MOUSE=1" >> /var/state/hwprof/hwprofile
else
  echo "HWPROF_PS2MOUSE=0" >> /var/state/hwprof/hwprofile
fi


This is ofcourse incomplete, but it should give a clue of how to detect
mouse presence and set up the correct protocol automatically. Just
create a script that sources /var/state/hwprof/hwprofile, checks the
value of $HWPROF_PS2MOUSE and changes your XF86Config accordingly.

Works like a charm. Ofcourse you have to set the trackpoint to
auto-disable or disable it manually at mouse presence.

André.