← Back to team overview

asus-ul30 team mailing list archive

Touchpad script

 

Here's a patch to the asus-laptop acpi scripts to make the
disable-touchpad key work.

I'd like to have a behavior more like syndaemon, which would disable
the keypad while you're typing and re-enable it after you stop typing.


Kai
diff --git a/acpi/asus-touchpad.sh b/acpi/asus-touchpad.sh
index 1c362b8..d5de1db 100755
--- a/acpi/asus-touchpad.sh
+++ b/acpi/asus-touchpad.sh
@@ -7,16 +7,18 @@
 # to hal (or whatever is replacing hal for such events)
 getXconsole
 
-XINPUTNUM=`xinput list 'SynPS/2 Synaptics TouchPad' | sed -n -e's/.*id=\([0-9]\+\).*/\1/p'`
+XINPUTNUM="ImPS/2 Logitech Wheel Mouse"
 
 # get the current state of the touchpad
-TPSTATUS=`xinput list-props $XINPUTNUM | awk '/Synaptics Off/ { print $NF }'`
 
-# if getting the status failed, exit
-test -z $TPSTATUS && exit 1
+xinput list-props 'ImPS/2 Logitech Wheel Mouse' | awk -F '\t' '
+    FNR==1 && match($1,/'"'.*'"'/) {
+        DEVICE=substr($1,RSTART+1,RLENGTH-2)
+    }
+    match($2,/Synaptics Off|Device Enabled/) {
+        PROPERTY=substr($2,RSTART,RLENGTH)
+        STATE=$3
+        system("xinput set-int-prop \"" DEVICE "\" \"" PROPERTY "\" 8 " !STATE)
+    }
+'
 
-if [ $TPSTATUS = 0 ]; then
-   xinput set-int-prop $XINPUTNUM "Synaptics Off" 8 1
-else
-   xinput set-int-prop $XINPUTNUM "Synaptics Off" 8 0
-fi
diff --git a/acpi/events/asus-touchpad b/acpi/events/asus-touchpad
index 6c9c166..4289397 100644
--- a/acpi/events/asus-touchpad
+++ b/acpi/events/asus-touchpad
@@ -3,4 +3,5 @@
 # /etc/acpi/asus-touchpad.sh for further processing.
 
 event=hotkey (ATKD|HOTK) 0000006a
+event=hotkey (ATKD|HOTK) 0000006b
 action=/etc/acpi/asus-touchpad.sh