Proper touchpad thumb & palm detection with libinput

31,733

Solution 1

This is how to install libinput to Ubuntu.

  1. Install some needed packages

    sudo apt-get install git build-essential autoconf automake pkg-config libtool
    sudo apt-get install libmtdev1 libmtdev-dev libudev-dev libevdev-dev xutils-dev libwacom-dev
    
  2. Install xserver-xorg-dev. For 14.04.3 it may be xserver-xorg-dev-lts-vivid. Be careful. You need to check what xserver-xorg package is installed.

    sudo apt-get install xserver-xorg-dev
    
  3. Clone libinput and xf86-input-libinput.

    git clone git://anongit.freedesktop.org/git/wayland/libinput
    git clone git://anongit.freedesktop.org/xorg/driver/xf86-input-libinput
    
  4. Build and install.

    cd libinput
    ./autogen.sh --prefix=/usr
    make && sudo make install
    
    cd ../xf86-input-libinput
    ./autogen.sh --prefix=/usr
    make && sudo make install
    
  5. Add to file conf/90-libinput.conf string Option "Tapping" "True" before EndSection to the touchpad section.

  6. Copy config file to enable libinput.

    sudo cp conf/90-libinput.conf /usr/share/X11/xorg.conf.d/
    

Log off and log on.

You will see that libinput is used by running xinput list-props <your_touchpad_id>.

If you do not like using libinput, you can always disable it by

sudo rm /usr/share/X11/xorg.conf.d/90-libinput.conf

I just installed it, now I am figuring out how to setup palm detection. It looks like it is enabled by default, but I do not quite understand yet how does it use kernel reported width and pressure.

It looks like currently there are no major advantages of using libinput in Ubuntu.

xf86-input-libinput just wraps it to Xorg and nothing else. So extra gestures are not supported. At least I do not know if they do. Wayland or Mir will be more capable, I guess.

After some testing I found an advantage. There is an issue with xorg-synaptics that when you put a finger on button area, you can't use another finger to move cursor. That is inconvenient for people who like to use hardware buttons for clicking. That problem has been reported many times as a bug.

In libinput there is no this issue at all.

That was a fun to test. Thanks for the question.

Solution 2

For Ubuntu 15.10+ you can install libinput (wily, xenial, yakkety) through apt:

sudo apt install xserver-xorg-input-libinput

I did still have to edit the config file to enable tapping, I assume as Unity absorbs libinput it'll expose this via control panel settings (I used vi here, you can use gedit or whatever you like):

Edit the following file (tested on 16.04 2016-4-14 and 16.10 2016-10-14):

sudo vi /usr/share/X11/xorg.conf.d/90-libinput.conf 

Adjust the 'touchpad' section to add Option "tapping" "True" and Option "DisableWhileTyping" "True" if you prefer this behavior:

Section "InputClass"
    Identifier "libinput touchpad catchall"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
    Option "Tapping" "True"
    Option "DisableWhileTyping" "True"
EndSection

Log out, log in .. enjoy! :)

Solution 3

On 16.04 you have to install xserver-xorg-input-libinput-hwe-16.04 instead

Problem installing libinput on 16.04.2

Solution 4

I had a similar problem on Lubuntu 17. I tried installing libinput and editing the .conf file to no avail.

But then I saw @Pilot6 post above about using xinput to verify that libinput is active (would also be nice to know what's the criterion to verify for, but I digress).

I checked my xinput with xinput list-props 14 (could be a different number in your case).

which gave me a synaptics touchpad.

In the list there was an option for palm detection with a number associated to it (316).

So I used xinput set-prop 14 316 1 to activate palm detection. And it finally works.

Share:
31,733

Related videos on Youtube

tomodachi
Author by

tomodachi

Updated on September 18, 2022

Comments

  • tomodachi
    tomodachi over 1 year

    So libinput its nearing its first stable release with a release candidate

    Which adds proper support for thumb / palm detection on touch pads along with swipe & pinch gesture support something dearly missed in Linux for multi touch capable laptops.

    Can anyone provide a good instruction on how to install it on Ubuntu 15.04

    As I believe we wont be seeing it as default in a Ubuntu installation for a while.

    • Pilot6
      Pilot6 almost 9 years
      Palm detection depends on kernel touchpad driver and can be setup in xorg-synaptics as well. What touchpad do you have?
    • RCF
      RCF almost 9 years
      @Pilot6 the package is available for download, but the readme file does not give specific instructions on how to compile to kernel.
    • Pilot6
      Pilot6 almost 9 years
      @RCF-U15.04 libinput is a user space app. It has nothing to do with kernel. It just uses events reported by kernel.
    • Pilot6
      Pilot6 almost 9 years
      @tomodachi If you want to set up palm detection well in Ubuntu, you can ask another question and I will help you.
  • VRR
    VRR almost 9 years
    @Pilot6 What's the point in "extra gestures are not supported"?
  • Pilot6
    Pilot6 almost 9 years
    @VRR The point is that default Ubuntu DE does not support many gestures. Just having libinput does not change it. 1,2,3 finger taps work out of the box. Palm detection is potentially more smart, but it seems that it does not support touchpads reporting only width. New models do non support pressure, because they work as touchscreen, etc.
  • Pilot6
    Pilot6 almost 9 years
    If you have problems just remove /usr/share/X11/xorg.conf.d/99-libinput.conf. sudo rm /usr/share/X11/xorg.conf.d/99-libinput.conf
  • hunch
    hunch almost 9 years
    That is not solving the problem. Can you mention something about the xserver-xorg-dev....where you have also mentioned ..be careful.. How to revert back to older version..
  • Pilot6
    Pilot6 almost 9 years
    Ask a separate question. Describe what you did, what is Ubuntu version, etc. That can't be solved here in comments.
  • hg8
    hg8 over 8 years
    Thanks for this great answer @Pilot6 . I have done all the steps successfully but when I run xinput list-props 15 there is no libinput mention. Have I missed something ? Is there another way to check if libinput is used?
  • Pilot6
    Pilot6 over 8 years
    @hg8 I suggest asking another question and post there output of xinput and xinput list-props 14
  • Gocht
    Gocht over 8 years
    I got a dependencies error message when running sudo apt-get install xserver-xorg-dev
  • Pilot6
    Pilot6 over 8 years
    You probably have an LTS version of Ubuntu. You need to install -lts-vivid or something else. @Gocht
  • Gocht
    Gocht over 8 years
    I don't understand why i got dependencies error with ` libcheese-gtk23 (>= 3.4.0)` and libcheese7 (>= 3.0.1) when I run sudo sudo apt-get install xserver-xorg-dev-lts-vivid. But when I run sudo dpkg -s libcheese-gtk23 I got Version: 3.10.2-0ubuntu2 and the same for the another package. @Pilot6
  • Pilot6
    Pilot6 over 8 years
    You'd better ask another question. It can't be solved in comments. Probably you do not have xserver-xorg-lts-vivid but some other version.
  • Gocht
    Gocht over 8 years
    Well, I am lost at this point. I try something else. @Pilot6
  • rubo77
    rubo77 over 8 years
    Would this work in xfce4 on Ubuntu Studio or Xubuntu 15.10 too?
  • Pilot6
    Pilot6 over 8 years
    Yes, why not. Regarding 15.10 see the other question. It is easier.
  • Pilot6
    Pilot6 over 8 years
    @tomodachi Please do not make wrong edits. Your command was wrong. You missed t, etc. Either way anyone can choose which options to use.
  • Xu Wang
    Xu Wang over 8 years
    @Pilot6 bad news: your instructions in this answer have been reposted without attribution or linking back to this answer (unless you are part of Barton's "tech team"). See here: bartongeorge.net/2015/09/30/… . Good news: your instructions here have had a wide impact and XPS 13 users are thankful.
  • Pilot6
    Pilot6 over 8 years
    @XuWang I do not really care about repostings or attributions.
  • Pilot6
    Pilot6 about 8 years
    There is no "PalmDetection" option in libinput, DisableWhileTyping is on by default. So there is no need to add all this.
  • JimB
    JimB about 8 years
    Adjusted and removed both options. I left 'Tapping' on because it's not on by default.
  • Pilot6
    Pilot6 about 8 years
    And also I do not recommend to use libinput for all devices. Keyboard lags in my case, so I picked the touchpad event, in my case event5 and wrote it to that file.
  • BeeOnRope
    BeeOnRope almost 8 years
    @Pilot6 - can you give a few more details about how to use libinput for touchpad only?
  • David784
    David784 almost 8 years
    It appears you can also add Option "AccelSpeed" "-0.5", where the value can be a float from -1 (slower cursor) to +1 (faster cursor). You can also experiment with this and other values using xinput. first find the id by running xinput, then if your id is 12, you can do xinput list-props 12 to list all props. if you want to change one, get the int for the prop (e.g. libinput Accel Speed (281): -0.500000), then you can do xinput set-prop 12 281 -0.4 to change the accel to -0.4.
  • orschiro
    orschiro about 7 years
    I followed these instructions on 17.04. Moreover, I removed xserver-xorg-input-synaptics to ensure that libinput is being used. However, then my touchpad does not work at all on my Thinkpad X230.
  • Ghos3t
    Ghos3t about 7 years
    I followed these instructions and now I get an error message when logging in. "Error found when loading /home/prem/.xprofile: /home/prem/.xprofile: line 1: synclient: command not found...........". Also, my touchegg gestures no longer work. How do I undo the steps taken and bring my system back to how it was.
  • JimB
    JimB about 7 years
    These instructions don't use synclient, you must have put that into some other 'dot' files that run on launching. Can you search for synclient in your dot files in your home directory? you can uninstall libinput and go back to the synaptic drivers ...just be sure to remove the startup script the instructions had you create.
  • Olivier Bégassat
    Olivier Bégassat about 6 years
    I'm trying to do what you suggest in your answer. But I run into a problem when running the ./autogen.sh --prefix=/usr portion. It tells me bash: ./autogen.sh: No such file or directory And indeed, ls reveals no autogen.sh is present (I'm not sure this is relevant, I'm totally new to linux). In any case, I followed the steps you outlined ahead of this, any idea of what may have gone wrong and how to fix it ? Thanks : )