Pimp up the touchpad of your notebook
Although equipped with a very capable driver by now, the standard installation 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 wasn’t 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 , unless they’re willing to get convinced…
First of all, mark the following functions in the Touchpad section of the “Mouse and Touchpad” settings:
- Enable touchpad
- Tap to click
- Disable touchpad while typing
- 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 test -d /etc/X11/xorg.conf || mkdir /etc/X11/xorg.conf.d …$ sudo gedit /etc/X11/xorg.conf.d/50-synaptics.conf
If the file isn’t empty, somebody has made it up already 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" 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 worked in Nadia 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, log out from your graphic session and log in anew. With the command
…$ xinput test ID_number_from_the_very_first_command
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
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 . You can achieve this by setting the leftmost title bar button in cinnamon’s windows settings to "close".
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.
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 (if you have trouble getting it to work, try touchegg instead):
…$ 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, for example Shift + Super (Windows) + Down to minimize a window, and don’t forget to enable window tiling and snapping in cinnamon’s corresponding 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 (under Menu› Preferences› Startup Applications), 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 ): a relatively big surface.
If you’re drawing sketches or editing photographs a lot, you can as well use a stylus for touchscreen devices like the iPad — this could definitively replace your mouse, as it does for me.
Summary of touchpad actions
|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)||—||push tile up|
|drag down||—||push tile down|
|drag right||—||push tile right|
|drag left||—||push tile left|
|rotate right||—||—||—||increase zoom level|
|rotate left||—||—||—||decrease zoom level|
In case of basic problems
For troubleshooting, please refer to this resource on the Archlinux wiki.
Tags: touchpad, clickpad, synaptics, multi-finger taps, mouse gestures
Created: 1 year ago.
Last edited: 1 month ago.
Reviewed: 1 year ago.
Read 0 times.
|1 month ago||
|@GuizmoPhil: To clarify things, xinput reports the position of the mouse pointer, not that of your fingers. As far as LeftEdge is concerned, there is a picture in man 4 synaptics that explains the differences.|
|1 month ago||
I finally had time to try again this tutorial with the updated info. I need some advice regarding the touchpad size.
When I move y finger on the touchpad, I am indeed getting position.
Let's take this as an example.
motion a=2475 a=2703
Anything with  means it's moving on the X axis, and  on the Y axis, am I right?
When I move my finger to the left completly, I get motion a=1472 from at least an inch from the touchpad border. Which makes me think that the size the OS think the touchpad is, is wrong.
When I type synclient -l, it says that the LeftEgde is 1763.
So am I right saying that the operating system does not know the correct size of my touchpad? 1472 should be the LeftEdge, right?
If this is the case, where can I configure correctly the touchpad size. All my Edges seems to be way off, I think this could explain the erratic cursor behavior I am having.
I know that this is not exactly part of the tutorial, but my touchpad is a piece of crap in Linux, I'm kind of depressed having to carry a mouse all the time.
Thanks in advance,
|1 month ago||
@GuizmoPhil: Sorry about that, but the debugging facility had been removed from synclient in the meantime. You should use xinput instead — I’ve updated the tutorial accordingly.
Configuration goes into /etc/…, thus you should _always_ edit the file in /usr/share/X11/xorg.conf.d/. However, if that directory doesn’t exist, you must create it before starting the text editor — see above.
|1 month ago||
I've a couple of questions regarding this tutorial.
Using "synclient -m 1" ended up with an error as follow:
synclient: invalid option -- 'm'
Usage: synclient [-h] [-l] [-V] [-?] [var1=value1 [var2=value2] ...]
-l List current user settings
-V Print synclient version string and exit
-? Show this help message
var=value Set user parameter 'var' to 'value'.
After googling around, it seems that the "-m" option has been completely removed from the synclient 1.7.x. Do you know how to downgrade to 1.6.x? I am running on Rebecca.
Also, I could not find any directory "xorg.conf.d" in /etc/X11/, I could only find the 50-synaptics.conf file in /usr/share/X11/xorg.conf.d/.
Do I need to edit the file in /usr/... or do I need to create one in /etc/...?
Thanks in advance,
|2 months ago||
|@Wild_Penguin: The problems you’re experiencing must be related to your system’s configuration somehow. In Rebecca, everything still works for me as it did in Nadia.|
|3 months ago||
|Just install new kernel version (for now 3.16.0-28) via Update manager->View->Linux kernel. This solves problem for me.|
|3 months ago||
|Too bad ginn doesn't work anymore. Also, disabling touchbad while typing does not work, either. Putting the above file in /etc/X11/xorg.conf.d will freeze the whole touchpad. So, a new up-to-date guide is needed! I'm trying to figure things out and will comment here if I get something done =)|
|1 year ago||
|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 ?!|
|1 year ago||
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:
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?
|1 year ago||
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||
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||
|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
- Auto Updating the Package List for the Update Manager
- HOWTO Link Video Capture to Video Key
- HOWTO Replace Kernel Mode Hibernation by User Mode Variant Perfectly
- HOWTO Embellish the Boot Screen (grub2)
- Do you need to optimize your SSD?
- Some Help With Nemo’s Bulk Renaming
- HOWTO Make Folder (File) Sharing Work Under Rebecca
- HOWTO Upgrade or Install Linux Mint by Keeping Your Data and Settings