Wednesday, September 18, 2013

Touch pad deactivation while typing and palm detection


I was having the same issue with my ASUS K55A touch-pad has the same issue whether under Arch Linux, or Ubuntu, and I imagine this applies to a lot of other touch-pads out there.  I'm running Openbox in Arch and Semplice (Debian Sid)  Mate in Ubuntu, but this should work for enlightenment, Gnome or any other desktop you might use. 

Set up palm detection:

Turn on palm detection, in a terminal type:
$ synclient PalmDetect=1

Set the maximum width that should be interpreted as a finger instead of a palm.  I choose 4, most how-tos use 10, it's good to do a bit of guess and test here:
$ synclient PalmMinWidth=4
 
Then, set the minimum height of a palm vs a finger:
$ synclient PalmMinZ=50 

Finally, under Ubuntu, 3 finger middle click is not enabled by default, so if you want to enable it use:
$ synclient TapButton2=3 TapButton3=2

In theory, this should enable 2 finger tap for middle click, and 3 finger tap for right click, but in Ubuntu 13.04 the resulting behavior is exactly the opposite.  Therefore, if you prefer 2 finger tap for middle click use:
$ synclient TapButton2=2 TapButton3=3 

To make this permanent once you have found the correct settings, save them into 50-synaptics.conf which is located at /usr/share/X11/xorg.conf.d/50-synaptics.confin  Debian/Ubuntu (Semplice) and at /etc/X11/xorg.conf.d/50-synaptics.conf in Arch Linux based distros, (the first "InputClass" part is for the multi-touch middle click fix, which is already enabled in Arch so you shouldn't need to add it):

Section "InputClass"
    Identifier "touchpad catchall"
    Driver "synaptics"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Option "TapButton1" "1"
    Option "TapButton2" "2"
    Option "TapButton3" "3"
    Option "HorizTwoFingerScroll" "on"
    Option "VertTwoFingerScroll" "on"
EndSection


#synclient PalmDetect=1
Option "PalmDetect" "1"
#synclient PalmMinWidth=4
Option "PalmMinWidth" "4"
#synclient PalmMinZ=50
Option "PalmMinZ" "50"

Actually turning the touch-pad off:

While this solution is almost perfect.  It still really annoyed me that there wasn't a software delay of say a 0.5 second between when the last key-press was registered and when the touch-pad is active.  The Arch linux wiki on touch-pads gives some hints here as well, however, getting it to work was as straight forward as above.  Moreover, when I attempted to run the recommended script, multi-touch gestures were disabled for the remainder of my login session, or in other instances the touch-pad just stopped working all together.

As it turns out, if I run the script before executing the palm detection script then it actually seems to work.  However the script on the arch wiki it's not an ideal example.  A friend of a friend recommended the following instead, and after reading the syndaemon man file I'd have to agree:

$ syndaemon -K -i 0.5 -R -d 

The arch wiki claims that if you save this command to your  ~/.xinitrc file to have it executed automatically at your next log-in.  However when I did this I was unaware that the command must happen before the launch of the desktop (exec DESKTOP.session command).  After playing around with a ton of other config files and learning a ton about the SLiM display manager I finally realized that the command just needed to be moved further up the file as commands after the desktop launch wont be run until the desktop is quit.

1 comment:

  1. Just a heads up, this still seems to completely disable the touch-pad in Ubuntu.

    ReplyDelete