Several pointer devices are available on this laptop. The first one is the integrated Track Point. This device is handled as a PS/2 input device also by XFree86 and by GPM (Generic Purpose Mouse) in console mode. This device is seen by Linux through /dev/psaux.
Here is the excerpt of my /etc/X11/XF86Config (XFree86 version 3.3.6):
Section "Pointer" Protocol "GlidePointPS/2" Device "/dev/psaux" BaudRate 1200 Resolution 100 Buttons 3 EndSection
GPM is started with the following options in /etc/sysconfig/mouse on my Redhat 6.2 config :
FULLNAME="ALPS - GlidePoint (PS/2)" MOUSETYPE="ps2" XEMU3="no" XMOUSETYPE="GlidePointPS/2"
Manually, GPM is started with the following options :
gpm -t ps2
The trackpoint can also provide presure information thanks to the new Linux Trackpoint Utilities.
I chose the Serial/PS2 Logitech wheel mouse. Please consult this hardware compatability page to ensure that your model is supported. Basically, OEM Logitech mices use a different chipset than boxed ones, and the wheel protocol is not supported. OEM models can be recognized by a black logo instead of a colored one on the top of the mouse body.
You can plug this mouse into the rear PS/2 port, and it is recognized through the same device as the Trackpoint. You don't have to change your configuration files to get it recognized. Moreover, external mouse and trackpoint can simultaneously be used. You'll have to enable the external PS2 port with the multipurpose tpctl utility. You'll to enable both internal and external pointing devices with this utility.
tpctl --spx=enable
In this way, I couldn't get the wheel running. So I needed to plug this mouse on the serial port.
The mouse was provided with a PS2/DB9 adaptor, that allowed me to plug it into the external serial port. This port is seen by Linux as the /dev/ttyS1 device. You have to change your XF86Config file accordingly:
Section "Pointer" Protocol "Auto" Device "/dev/ttyS1" BaudRate 1200 Resolution 100 Buttons 3 ZAxisMapping 4 5 EndSection
You'll need the IMWheel package to convert X11 events coming from the mouse wheel into keystrokes according to a particular window. It allows you to customize the wheel action independantly for each client.
The script /etc/X11/xinit/xinitrc.d/imwheel script is in charge of launching imwheel when X starts. The file /etc/X11/imwheelrc provides the event-to-keystroke conversion in a human readable and easily-extendable format.
If X doesn't start : the mouse has to be connected to the serial port when X starts. The device choice may be wrong, try /dev/ttyS0 instead. The X server may also fail to detect the mouse protocol. The logitech mouse supports Plug-and-play intialization. The end of the X server log provide the way the mouse is detected :
Mouse: PnP ID string: '(!DLGI8051\\MOUSE\PNP0F08,PNP0F0C8C)' Mouse: PnP rev 1.00 Mouse: protocol: 9
X starts but the mouse pointer doesn't move : wrong protocol ?
Before starting imwheel, you can check if you Xserver correctly handles the wheel movement. Just start xev and play with it. I obtain the following log when moving the wheel into the event window :
KeymapNotify event, serial 21, synthetic NO, window 0x0, keys: 38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ButtonRelease event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x800002, time 1824563656, (41,39), root:(47,60), state 0x800, button 4, same_screen YES LeaveNotify event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x0, time 1824563656, (41,39), root:(47,60), mode NotifyUngrab, detail NotifyInferior, same_screen YES, focus YES, state 0 ButtonPress event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x800002, time 1824564106, (41,39), root:(47,60), state 0x0, button 5, same_screen YES EnterNotify event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x0, time 1824564106, (41,39), root:(47,60), mode NotifyGrab, detail NotifyInferior, same_screen YES, focus YES, state 4096 KeymapNotify event, serial 21, synthetic NO, window 0x0, keys: 38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ButtonRelease event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x800002, time 1824564106, (41,39), root:(47,60), state 0x1000, button 5, same_screen YES LeaveNotify event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x0, time 1824564106, (41,39), root:(47,60), mode NotifyUngrab, detail NotifyInferior, same_screen YES, focus YES, state 0 ButtonPress event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x800002, time 1824564326, (41,39), root:(47,60), state 0x0, button 5, same_screen YES EnterNotify event, serial 21, synthetic NO, window 0x800001, root 0x26, subw 0x0, time 1824564326, (41,39), root:(47,60), mode NotifyGrab, detail NotifyInferior, same_screen YES, focus YES, state 4096
You can see here that wheel events are correctly mapped into button clicks, respectively button 4 for upwards wheel move and button 5 for downwards wheel move. If this stage works, you'll just have to let imwheel work to do the conversion into keystrokes for various clients. Try for example with Netscape or with a regular XTerm. Each wheel move should be converted into a Page_UP/Page_DOWN key event.
It is possible to ask GPM to listen on two or more devices simultaneously:
gpm -k gpm -t ps2 -m /dev/psaux -M -t pnp -m /dev/ttyS1
This way, I still can use both devices (Mouse on serial port and trackpoint) simultaneously. *But*, the mouse device is no longer recognized when X starts. So, I suggest, you keep running gpm only on /dev/psaux.
Another way to run imwheel is to use gpm instead of X events. I couldn't get the wheel running by this way, but It may worth more investigation. You'll need imwheel-0.9.8 and the included gpm-1.19.0 package, that accepts some more options related to the wheel functions.
Start gpm (-WR option allow redirect mouse events through a pipe and wheel events handling, the events are written to the pipe with the MouseSystem protocol by default, so you'll have to modify your /etc/X11/XF86Config accordingly).
gpm -t ps2 -m /dev/psaux -M -t pnp -m /dev/ttyS1 -WR
Change the Pointer section in your XF86Config file (/dev/gpmdata is the name of the pipe used by gpm) :
Section "Pointer" Protocol "MouseSystems" Device "/dev/gpmdata" BaudRate 1200 Resolution 100 Buttons 3 EndSection
Start X. Mouse should move the pointer.
Start imwheel, and tell it to watch the GPM pipe instead of the X events :
imwheel -k --wheel-fifo
If all works fine, the pipe /dev/gpmdata is written by gpm and read by X, and /dev/gpmwheel is read by imwheel and written by gpm :
[root@bonobo bellet]# lsof | grep gpmdata gpm 14104 root 3u FIFO 3,1 174008 /dev/gpmdata X 14119 root 4u FIFO 3,1 174008 /dev/gpmdata [root@bonobo bellet]# lsof | grep gpmwheel gpm 14104 root 4u FIFO 3,1 177368 /dev/gpmwheel imwheel 14206 bellet 4r FIFO 3,1 177368 /dev/gpmwheel
With this solution, you can indifferently use both internal and external pointer simultaneously, in console mode and in X. GPM handles the mouse protocol in both cases.
But, I didn't succeed in making GPM recognize the wheel movements in this configuration, so help and suggestions are welcome :-)
The wheel movement with my logitech mouse is only recognized with XFree86 (I'm running version 3.3.6), when the mouse is plugged on the exterial serial port of my thinkpad, and with the PnP("Auto") protocol on the XServer side.
The second solution, with gpm as a uniformized mouse handler process for both console and X is more seduisant, but doesn't work with wheel unfortunately. Any help of advice is welcome.
Last modified : Sun Oct 19 21:25:22 CEST 2003