On Wed, Jul 23, 2003 at 05:18:36PM +0300, Micha Feigin wrote: | How do I set up gpm to use two mice with different protocols and get it | to repeat to x?
This is a little bit tricky, and not wholly pretty. | I have a touchpad which acts as a serial mouse (autops2 seems to work | for it) don't know exactly which one (sony vaio pcg laptop) and a | logtech usb mouse. Ok. | I configured X directly without regard to gpm and it works fine except | that I get different rates under kernel 2.4 and 2.6. | Under the console with the autops2 protocol I don't get the third button | functionality of the logitech, and with imps2 protocol I can't past | using the touchpad (no emulate 3 button ?). | When I try to use the -M option the mouse doesn't respond at all. | | How would I configure gpm to give full button functionality for both | mice? The issue I ran into is gpm only has one FIFO it repeats on. Since the FIFO acts as a (single) device, it can only repeat one protocol. So what I have is the following : ---- /etc/gpm.conf repeat_type=raw # touchpad device=/dev/misc/psaux type=ps2 responsiveness= append="" sample_rate= # Logitech MouseMan Wheel device2=/dev/input/mice type2=ps2 (I added this at line 30 so it accepts the "extra" options in gpm.conf) ---- /etc/init.d/gpm # If both the second device and type are specified, use it. # How should we report the error if only one is specified? if [ -n "$device2" ] && [ -n "$type2" ] ; then cmdln="$cmdln -M -m $device2 -t $type2" if [ -n "$responsiveness2" ]; then cmdln="$cmdln -r $responsiveness2"; fi if [ -n "$append2" ]; then cmdln="$cmdln $append2"; fi fi ---- /etc/X11/XF86Config-4 # in ServerLayout section InputDevice "input-dev mouse" "SendCoreEvents" InputDevice "gpm mouse" "CorePointer" Section "InputDevice" Identifier "input-dev mouse" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "IMPS/2" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" Identifier "gpm mouse" Driver "mouse" Option "Device" "/dev/gpmdata" Option "Protocol" "PS/2" #Option "Protocol" "IMPS/2" Option "ZAxisMapping" "4 5" Option "Emulate3Buttons" EndSection ---- ---- The end result is that 1) gpm reads both the touchpad and the usb mouse, using the 'PS/2' protocol. gpm repeats what it reads out its fifo. This means that both mice work as basic PS/2 mice in the console. No scroll wheel, no middle button. 2) X reads from gpm's fifo. Thus both mice work in X just as they do in the console. 3) X reads directly from the USB mouse, using the IMPS/2 protocol instead. This means that the logitech mouse has the scroll wheel and all in X, though not in the console. Since the mouse's events are repeated to X through gpm _and_ X reads them directly from the kernel, the mouse is doubly-sensitive. I have noticed that while race conditions exist when both gpm and X read from /dev/psaux, this isn't a problem with the USB devices. A better solution is for gpm to provide two separate repeat fifos so that each mouse can use its own protocol when talking to X. Another better solution is for gpm to adapt its input protocols to a specified output protocol. That is for gpm to read PS/2 on /dev/psaux from the touch pad and read IMPS/2 on the USB port from the logitech mouse, and then output only IMPS/2 on the fifo. Then X can use IMPS/2 and get all the functionality of both mice from the one device. This would only work to the extent that both mouse protocols are "compatible" or at least adaptable. Both of these better solutions requires a developer to extend gpm. So instead I live with extra sensitivity in my USB mouse, but it works on the console and in X, and gives me the scroll wheel in X. HTH, -D -- Microsoft is to operating systems & security .... .... what McDonald's is to gourmet cooking http://dman13.dyndns.org/~dman/
pgp00000.pgp
Description: PGP signature