Pointer capture for touchpads?

Richard Zidlicky rz at linux-m68k.org
Mon May 31 22:54:39 UTC 2010


Hi,

I have a simple proof of concept script for controlling the Sentelic touchpad, attached it 
if it is usefull to someone.

In principle it allows me to turn on/off the whole device or particular features
such as vertical/horizontal scroll or tap-click - and thus making the device much 
more tolerable.

It has somewhat nasty preconditions: requires either root privs for the scroll/click control
or Xserver access for enabling/disabling :( So I am not sure how it could be intergated into 
the desktop.

Another interesting thing I found is "evdaemon" - http://codegrove.org/evdaemon/, did
not try it yet but looks like it could do everything what syndaemon can do and a few other 
interesting things without beeing limitted to any particular device.

Richard
-------------- next part --------------
#!/bin/bash
#

FDIR=`find /sys/devices/platform/i8042/ -name protocol|xargs grep -l 'FSPPS/2' | xargs dirname`

if [ -z "$FDIR" ]; then
    echo "no Sentelic touchpad detected"
    exit 1
fi

print_usage() {
   cat <<EOF
$0 command line script for controlling the sentelic touchpad
Usage: $0 [-R] [-C 0|1] [-V 0|1] [-H 0|1] [-e 0|1]
  -R         reset the driver
  -C <1|0>   enables or disable tap click
  -V <1|0>   enables or disable vertical scroll
  -H <1|0>   enables or disable horizontal scroll
  -e <1|0>   enable or disable device

EOF
}

while getopts ":RC:V:H:e:" param
do
   case "$param" in
      t) echo "t: $OPTARG";;
      R)
          echo -n R > $FDIR/flags ;;
      C)
         case $OPTARG in
	     1) val=C;;
	     0) val=c;;
	     *) val=$OPTARG
	 esac
          echo -n $val > $FDIR/flags ;;
      V)
          echo -n $OPTARG > $FDIR/vscroll ;;
      H)
          echo -n $OPTARG > $FDIR/hscroll ;;
      e)
          xinput --set-prop 'FSPPS/2 Sentelic FingerSensingPad' "Device Enabled" $OPTARG ;;
      \?)
      print_usage "unknown argument -$OPTARG"
             ;;
      \:)
      print_usage "argument missing for -$OPTARG"
             ;;
   esac
done


More information about the kde mailing list