They offer different flash templates with latest features.
Login

Forgot password
Register
Back
Written by:
MagicMint
Score: 5
votes: 8
Format: Article

 Pimp up the touchpad of your notebook


Scope

Although equipped with a very capable driver by now, the standard installation (LM14 Nadia) brought up the touchpad of my Asus UX-32A Zenbook in a state in which it was indeed usable from the first moment on, but without any of its more advanced features. Thus the right button click and one-finger scrolling worked, but there was no middle button nor any multi-finger gesture. As far as I know, these features work only for newer models of Synaptics or Elantech, which was the case of the touchpad of my notebook. The vendor of an already working touchpad is revealed by a quick command:
…$ xinput | grep -i touchpad
As there is definitely more to it in Linux, although at the cost of some manual configuration, here is a detailed description about how to come up to the perfection of a MacBook’s touchpad under Mac OS X. This comparison suggests it already: we’re dealing here first and foremost with newer clickpads, i.e. with touchpads that like Apple’s one do not have any physical buttons. However, beside the soft buttons the following applies also to other types of touchpads, provided that they’re serviced by the synaptics driver. Chances are that this is the one you are using if your notebook has a touchpad, but the version of the driver is important (it should be at least v1.6.x), so let’s check it out:
…$ apt-show-versions | grep input-synaptics
And don’t forget, this tutorial is not for mouse lovers crying, unless they’re willing to get convinced…

Configuration

First of all, mark the following functions in the Touchpad section of the “Mouse and Touchpad” settings:
  •  Enable touchpad
  •  Disable touchpad while typing
  •  Enable mouseclicks with touchpad
  •  Two-finger scrolling
  •  Enable horizontal scrolling
The secrets of the driver’s extended abilities are hidden in the file /usr/share/X11/xorg.conf.d/50-synaptics.conf which we must only adapt to our needs. While one can elucidate the options therein with a simple command man 4 synaptics, we’ll also need the synclient command (which is part of the driver package) to measure the dimensions of the soft buttons of the clickpad later on.

It is easier to start out with a working example, so enter in a terminal:
…$ sudo gedit /etc/X11/xorg.conf.d/50-synaptics.conf
If the file isn’t empty, somebody has made it up already wink and you’ll merely have to add the options which you’re interested in, otherwise just paste in the following contents as a whole:
# /etc/X11/xorg.conf.d/50-synaptics.conf  (MagicMint) M0427
# Additional options may be added in the form of
#   Option "OptionName" "value"
# See man synaptics (4) for details

Section "InputClass"
 Identifier "touchpad ignore duplicates"
 # Ignore events from old driver
 MatchIsTouchpad "on"
 MatchOS "Linux"
 MatchDevicePath "/dev/input/mouse*"
 Option "Ignore" "on"
EndSection

Section "InputClass"
 Identifier "touchpad catchall"
 # Device
 Driver "synaptics"
 MatchIsTouchpad "on"
 MatchDevicePath "/dev/input/event*"

 # Palm detection
 Option "PalmDetect" "on"
 Option "PalmMinWidth" "4"
 Option "PalmMinZ" "1"

 # Dragging & tapping
 Option "LockedDrags" "on"
 Option "FastTaps" "on"
 Option "AccelFactor" "0.1028806" #2x
 Option "MinSpeed" "1"
 Option "MaxSpeed" "1.75"

 # For hardware debugging only
 Option "SHMConfig" "on"
EndSection

Section "InputClass"
 Identifier "Default clickpad buttons"
 # Lacking mouse buttons
 MatchDriver "synaptics"
 Option "LTCornerButton" "8"

 # Left-handed pad w/ middle button on the left side
 #Option "SoftButtonAreas" "1630 0 1737 0 0 1629 1737 0"

 # Right-handed pad w/ middle button on the right side
 Option "SoftButtonAreas" "0 1629 1737 0 1630 0 1737 0"
EndSection

Section "InputClass"
 Identifier "Multi-finger taps"
 MatchDriver "synaptics"

 # The following works only via synclient
 Option "TapButton1" "1"
 Option "TapButton2" "3"
 Option "TapButton3" "2"
EndSection

# End of configuration file

1. Section: Touchpad ignore duplicates

The duty of this section is to filter out touchpad events which would be potentially duplicated otherwise by a legacy driver, causing that way a race condition between both drivers which could prevent the touchpad from functioning properly.

2. Section: Touchpad catchall

This section is committed to the actual configuration of the touchpad. The options therein are self-explaining; in case of a doubt or extra wishes please refer to the manual page aforesaid. The acceleration factor is for instance the double of its original value — we’ll see in a moment how to measure that.

The point of this configuration file is, that for almost all settings of the touchpad, this is the only place where they will be remembered across sessions: most graphical utilities in GNOME, for example, do not guarantee this and in addition they’re incomplete at most.

3. Section: Default clickpad buttons

As we all know, PC mouses use to have more than just one button. Hence, even a clickpad like mine that has none pretends to have three of them:

1. left mouse button
2. right mouse button 3. middle mouse button

Assigning the right mouse button to the left of the clickpad is the right-handed variant in the file above, since this is the only way to use mouse gestures bound to the right button (in Opera, Firefox, etc.) with the thumb of the right hand.

Anyway, as touchpads differ in size, it is advisable to enter the exact coordinates of the four corners of such a soft button mimicked by the clickpad. In order to do so, with the brand new configuration file in effect (wherein the SHMConfig option must be set on as in the sample file above), log out from your graphic session and log in anew. With the command
…$ synclient -m 1
typed in a terminal, you can now easily find out these coordinates which you must then write down, of course. At this point you can also experiment with the speed settings of the pointer by listing and setting them via synclient:
…$ synclient -l
…$ synclient AccelFactor=0.12345678
After having modified the button coordinates and possibly the speed factors in the configuration file according to these notes, reset the SHMConfig option by writing a comment sign in front of it like this, and then restart the graphic session again:
#Option "SHMConfig" "on"

Closing the active window

The top left corner of the touchpad is assigned to a fictitious mouse button number 8 which will be used to close the active window on the screen. The choice of the top left corner follows from a right-handed view again, since it is out of any accidental reach of the right hand. (To be consistent with this, I’ve also re-arranged the window buttons in cinnamon — I’m a bit of nostalgic about Mac OS’ differences to Windows smiley. You can do this with dconf-tools by setting the key dconf› org› cinnamon› overrides› button_layout to the value "close:minimize,maximize", which in v1.8.8 can be done directly within the settings.)

This is a kind of automation task, so we need, well, the package xautomation. Furthermore, we should also install xbindkeys to realize the closing of a window with an emulated mouse button:
…$ sudo apt-get install xautomation xbindkeys
The linking between the two is done automagically by the file:
…$ gedit ~/.xbindkeysrc
Its contents should be the following:
# ~/.xbindkeysr  (MagicMint) H0129
# Bind the 8th mouse button to close the current window
"xte 'keydown Alt_L' 'key F4' 'keyup Alt_L'"
  b:8
# End of xbindkeys configuration

4. Section: Multi-finger taps

This section is appointed in theory to instantiating the multi-finger tap support of the driver in a way such that the number of fingers used to tap be the same as the figures in the illustration above, making thus the tap behave in the same manner as the corresponding soft button.

But for some reasons unknown to me, in xserver-xorg v1:7.7+1ubuntu4 this section has no effect at all. But we’ve learned already that there is also synclient to set an option of the driver. Since this must be done at each start of the graphical user interface, we must incorporate it into a command file to switch multi-finger tapping on:
…$ sudo gedit /usr/local/bin/tapbuttons.sh
Fill in the following:
#!/bin/sh
# /usr/local/bin/tapbuttons.sh  (MagicMint) M0426
# Set multi-finger tap on the Elantech touchpad
export DISPLAY=":0"
synclient TapButton1=1 TapButton2=3 TapButton3=2
# End of tapbuttons command file
Now, make the command file executable and then effective for the current session:
…$ sudo chmod +x /usr/local/bin/tapbuttons.sh
…$ tapbuttons.sh
Finally, add it to the autostart applications under Menu› Preferences› Startup Applications.

What if these tap settings are lost?

In a perfect world, we would be done by now surprise. But truly, the X server doesn’t burden himself with remembering these button settings: from time to time it will simply forget them.

Hence it’s better for your nerves if you add a launcher for tapbuttons.sh to the panel too. Moreover, you should install a cron job to automate that in:
…$ sudo gedit /etc/cron.d/tapbuttons
For a refresh interval of 5 minutes, the job looks like (replace your_user_name by yours):
# /etc/cron.d/tapbuttons
# Reloading touchpad & keyboard settings
*/5 * * * * your_user_name /usr/local/bin/tapbuttons.sh > /dev/null 2>&1
# End of cron job

Ultimate usage

For the time being, the synaptics driver cannot recognize more complex gestures such as pinching, rotating, etc. But nevertheless you can add them to the repertoire of your touchpad by means of ginn, a utility meant to incorporate legacy applications into Unity’s gesture schema in Ubuntu:
…$ sudo apt-get install ginn
In our installation we use it to provide 4 finger gestures (anything below this number of fingers is seized by synaptics). With that many fingers the “pinch” gesture didn’t work for me, so the following makes only usage of rotate, tap and drag to perform 7 standard actions on the active window (summarized at the end of this tutorial). Please verify in your keyboard’s shortcuts settings if the keys given match the desired actions, and don’t forget to enable edge tiling (a.k.a. “Aero snap”) in cinnamon’s windows settings.

You should replace the contents of the sample configuration file:
…$ sudo gedit /etc/ginn/wishes.xml
by the following contents and install ginn as an autostart program (see further above), thereby activating it after the next log in:
<ginn>
  <global>
 <!-- Application control -->
    <wish gesture="Rotate" fingers="4">
      <action name="rotateccw" when="update">
        <trigger prop="angle delta" min="-1.5" max="-0.08"/>
        <key modifier1="Control_L">plus</key>
      </action>
    </wish>
    <wish gesture="Rotate" fingers="4">
      <action name="rotatecw" when="update">
        <trigger prop="angle delta" min="0.08" max="1.5"/>
        <key modifier1="Control_L">minus</key>
      </action>
    </wish>

 <!-- Windows control -->
    <wish gesture="Tap" fingers="4">
      <action name="action1" when="update">
        <trigger prop="tap time" min="20" max="400"/>
 <key modifier1="Super_L" modifier2="Shift_L">Down</key>     
      </action>
    </wish>

    <wish gesture="Drag" fingers="4">
      <action name="action1" when="update">
        <trigger prop="delta y" min="40" max="600"/>
        <key modifier1="Super_L">Down</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="4">
      <action name="action1" when="update">
        <trigger prop="delta y" min="-600" max="-40"/>
        <key modifier1="Super_L">Up</key>
      </action>
    </wish>

    <wish gesture="Drag" fingers="4">
      <action name="action1" when="update">
        <trigger prop="delta x" min="40" max="600"/>
        <key modifier1="Super_L">Right</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="4">
      <action name="action1" when="update">
        <trigger prop="delta x" min="-600" max="-40"/>
        <key modifier1="Super_L">Left</key>
      </action>
    </wish>

  </global>
</ginn>

The ultimate tip

Besides having a highly configurable driver, modern clickpads offer another advantage too (although this is often seen as a serious disadvantage by many — otherwise there would be no extra key to switch them off wink): a relatively big surface.

If you’re drawing sketches or editing photographs a lot, you can as well use a stylus enlightened for touchscreen devices like the iPad — this could definitively replace your mouse, as it does for me.

Summary of touchpad actions

Action Fingers
  1 2 3 4
press left click: action right click: context menu,
begin browser gesture
middle click: paste
tap right click: context menu minimize window
top left corner tap close window
drag up move browser gestures (press only) maximize window
drag down unmaximize window
drag right snap to right
drag left snap to left
rotate right increase zoom level
rotate left decrease zoom level

Tags: touchpad, clickpad, synaptics, multi-finger taps, mouse gestures
Created: 1 year ago.
Last edited: 1 year ago.
Reviewed: 1 year ago.
Read 0 times.

Comments
10 months ago

MagicMint
You should try to deduce your SoftButtonAreas from the dimensions of your touchpad which should be (LeftEdge + RightEdge) × (TopEdge + BottomEdge). Anyway, you have a ClickPad = 0 in your parameters, so the touchpad doesn’t seem to have soft buttons ?!  
10 months ago

kamudhar
Hi,
I am a right handed touchpad user on LinuxMint 16 (64 bit Cinnamon edition). My 50-synaptics.conf file is an exact replica of the one given in this tutorial.
synclient -m 1 tells me that there is no option -m to the command synclient.
synclient -l gives me the following output:
Parameter settings:
LeftEdge = 1752
RightEdge = 5192
TopEdge = 1620
BottomEdge = 4236
FingerLow = 25
FingerHigh = 30
MaxTapTime = 180
MaxTapMove = 221
MaxDoubleTapTime = 180
SingleTapTimeout = 180
ClickTime = 100
EmulateMidButtonTime = 75
EmulateTwoFingerMinZ = 29
EmulateTwoFingerMinW = 5
VertScrollDelta = 100
HorizScrollDelta = 100
VertEdgeScroll = 1
HorizEdgeScroll = 0
CornerCoasting = 0
VertTwoFingerScroll = 0
HorizTwoFingerScroll = 0
MinSpeed = 1
MaxSpeed = 1.75
AccelFactor = 0.102881
TouchpadOff = 0
LockedDrags = 1
LockedDragTimeout = 5000
RTCornerButton = 0
RBCornerButton = 0
LTCornerButton = 8
LBCornerButton = 0
TapButton1 = 1
TapButton2 = 0
TapButton3 = 0
ClickFinger1 = 1
ClickFinger2 = 1
ClickFinger3 = 0
CircularScrolling = 0
CircScrollDelta = 0.1
CircScrollTrigger = 0
PalmDetect = 1
PalmMinWidth = 4
PalmMinZ = 1
CoastingSpeed = 20
CoastingFriction = 50
PressureMotionMinZ = 30
PressureMotionMaxZ = 160
PressureMotionMinFactor = 1
PressureMotionMaxFactor = 1
ResolutionDetect = 1
GrabEventDevice = 1
TapAndDragGesture = 1
AreaLeftEdge = 0
AreaRightEdge = 0
AreaTopEdge = 0
AreaBottomEdge = 0
HorizHysteresis = 25
VertHysteresis = 25
ClickPad = 0
What should I change in the 50-synaptics.conf file? I sense that I need to change this line:
Option "SoftButtonAreas" "I don't know what to put here".

Can someone help? Also, can I continue to follow this tutorial after I input the right coordinates?
 
11 months ago

MagicMint
The file you’re trying to open is is just a sample configuration that you don’t really need. Take the example discussed in the tutorial as a starting point, which must be saved as explained (don’t forget sudo!) into the real configuration directory of X11 which is /etc/X11/xorg.conf.d/, by the way.

If you need to modify it, read “man 4 synaptics” for details.
 
1 year ago

capitan02
im noob at mint and any other linux os, so i get stuck in the configuration part cos when i tried to save log i get the archive /usr/share/X11/xorg.conf.d/50-synaptics.conf doesn't exist :s
how do i get over that?
thanks beforehand for the help and sorry for my english spell XD
 
1 year ago

MagicMint
If you have basic problems to get the touchpad to work at all, there is a good guide on Ubuntu Wiki about debugging it: https://wiki.ubuntu.com/DebuggingTouchpadDetection.  

Other tutorials from MagicMint