[gpm]New Synaptic patch

Troy Schultz tschultz@canada.com
09 Apr 2002 12:08:37 -0400


I managed to resolve my problem with starting gpm using my init scripts,
the problem turned out to be the internal mechanism used by gpm to
ensure that more than 1 session does not run.

I added a line to the stop method in the script to also run "gpm -k" if
gpm's lock was present.

I am now using your synaptics_c_p4 patches as so far things seem OK, all
except for the 4-way RIGHT direction, and maybe the LEFT as well.  I'm
not sure what the best thing for these to do is.

With debug logging I get the following data from the 4-way scroll key
UP - 80 00 00 C2 01 00		(this wrong in my previous message)
RIGHT - 80 00 00 C2 00 02
DOWN - 80 00 00 C2 00 01
LEFT - 80 00 00 C2 02 00

The only other thing maybe the speed for scrolling using the 4-way
scroll key.  It is much faster than if I use the edge of the touchpad.

Here are the contents of my config files, mostly from the stock RedHat
7.2 setup but with some minor changes.

/etc/sysconfig/mouse  - a config file
FULLNAME="Synaptics touch pad"
MOUSETYPE="synps2"
XEMU3="yes"
XMOUSETYPE="ps2"

/etc/sysconfig/gpm - a config file
# Additional options for gpm (e.g. acceleration), device
OPTIONS="-Rimps2"
DEVICE="/dev/mouse"

/etc/init.d/gpm - the init script
#!/bin/bash
#
# chkconfig: 2345 85 15
# description: GPM adds mouse support to text-based Linux applications such \
#              the Midnight Commander. Is also allows mouse-based console \
#              cut-and-paste operations, and includes support for pop-up \
#              menus on the console.
# processname: gpm
# pidfile: /var/run/gpm.pid
# config1: /etc/sysconfig/mouse
# config2: /etc/sysconfig/gpm

# source function library
. /etc/init.d/functions
[ -e /etc/sysconfig/gpm ] && . /etc/sysconfig/gpm

MOUSECFG=/etc/sysconfig/mouse

RETVAL=0

start() {
	echo -n $"Starting console mouse services: "

	if [ -f "$MOUSECFG" ]; then
		. "$MOUSECFG"
	else
		echo $"(no mouse is configured)"
		exit 0
	fi

	if [ "$MOUSETYPE" = "none" ]; then
		echo $"(no mouse is configured)"
		exit 0
	fi


	if [ "$MOUSETYPE" = "Microsoft" ]; then
		MOUSETYPE=ms
	fi

	if [ -z "$DEVICE" ]; then
	    DEVICE="/dev/mouse"
	fi

	if [ -n "$MOUSETYPE" ]; then
		daemon gpm $OPTIONS -t $MOUSETYPE -m $DEVICE
	else
		daemon gpm $OPTIONS -m $DEVICE
	fi
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm
}

stop() {
	echo -n $"Shutting down console mouse services: "
	killproc gpm
	
	RETVAL=$?

	[ -e /var/run/gpm.pid ] && gpm -k
	
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gpm
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  condrestart)
	if [ -f /var/lock/subsys/gpm ]; then
	    stop
	    start
	    RETVAL=$?
	fi
	;;
  status)
	status gpm
	RETVAL=$?
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|condrestart|status}"
	exit 1
esac

exit $RETVAL



Best Regards
- Troy Schultz