No secondary button (right click) on touchpad

22,951

Solution 1

Basically, Ubuntu 18.04 currently defaults to "Mac" behavior on the touchpad. The technical details are that Ubuntu defaults libinput touchpads to "clickfingers" behavior.

To revert that, run this in a terminal:

gsettings set org.gnome.desktop.peripherals.touchpad click-method areas

Another option (thanks OP) is to install gnome-tweak-tool (either through your software manager or through sudo apt install gnome-tweak-tool in the terminal). Navigate to the “Keyboard & Mouse” sub-menu in the left menu of gnome-tweak-tool, and select “Areas” from the touchpad’s “Mouse Click Emulation” options in the right side panel, as shown in the red box in the image below: Relevant setting in gnome-tweak highlighted

[Warning: This fix is for the libinput driver that ships as the default input driver for Ubuntu 18.04. YMMV if you've installed the (different) synaptics driver before trying this fix.]

Solution 2

Right button event is generated when two fingers are held down on the touchpad when a physical click is generated. The location of the fingers does not matter and there are no software-defined button areas.

This is the default behavior on Ubuntu 18+ and Apple touchpads.

Share:
22,951

Related videos on Youtube

Yuvalem
Author by

Yuvalem

Updated on September 18, 2022

Comments

  • Yuvalem
    Yuvalem over 1 year

    I'm experiencing a serious problem with the new Ubuntu 18.04:

    System
    Dell XPS 13 with a freshly installed Ubuntu 18.04 LTS.

    Problem description
    The touchpad provides only primary button (single click and double click), but no secondary button. In particular, when using the "test Your Settings" option in Settings -> Devices -> Mouse & Touchpad, any click on the touchpad is signaled as primary button, no matter where I click (left or right side of the touchpad). This remains the case even after I change the Primary Button from Left to Right (in Settings -> Devices -> Mouse & Touchpad -> General).

    In comparison, an external mouse connected to my laptop (via usb) works fine: it provides both primary and secondary buttons with sides corresponding to the choice of Primary Button (in Settings -> Devices -> Mouse & Touchpad -> General).

    This may be related to Touchpad right click doesn't work on touchpad, only the buttons above it. Thinkpad E480 Ubuntu 18.04 LTS

    Any ideas?

    Update:
    Meanwhile, I found out that in addition to the solution proposed by EntropyWins, one can also control this touchpad behavior via the Tweaks tool (a.k.a. gnome-tweaks) under Keyboard & Mouse -> Touchpad -> Mouse Click Emulation. In any case, as EntropyWins explains in his answer, this is not a bug.

    • pomsky
      pomsky about 6 years
    • PatKilg
      PatKilg about 6 years
      The above fix might work because as I understand it, it overrides the newer libinput driver with the older synaptics driver. My fix below requires a simpler settings flip and still uses the new driver, so hopefully it is a bit less likely to cause other problems in the future. It also doesn't require a reboot!
  • Yuvalem
    Yuvalem about 6 years
    Worked like a charm, thanks heaps! I wonder if the default MAC setting is a smart thing...
  • PatKilg
    PatKilg about 6 years
    I tried to be clear about that in the bug report ;-)
  • PatKilg
    PatKilg about 6 years
    Also, I take Linus' approach to what is a bug: Don't f**k with things the user expects to work as it always has worked...
  • Pavel
    Pavel about 6 years
    Switching to the "area" method disables the right click altogether in my case (18.04, Acer Extensa 2510G). And I DO HATE the "fingers" method because you have to keep one finger on the touchpad or the menu disappears. Useless acrobatics just.
  • Pavel
    Pavel about 6 years
    Both methods now work correctly after renaming 50-libinput.conf to 90-libinput.conf to make sure it's read after 70-synaptics.conf. Hmm.
  • PatKilg
    PatKilg about 6 years
    Pavel--the reason my fix didn't work for you is (likely) because you have the synaptics drivers installed. 18.04 does not ship with the synaptics driver controlling the touchpad, you likely installed it yourself (or your flavor included them). My fix is for the libinput driver, not the synaptics driver.
  • emk2203
    emk2203 about 6 years
    @Pavel, where are the .conf files you mentioned located? I cannot find them on my system. I see the same behaviour as you do.
  • Pavel
    Pavel about 6 years
    In /usr/share/X11/xorg.conf.d/ @emk2203
  • emk2203
    emk2203 about 6 years
    That did the trick. But how did you get both methods to work? For me, it's either the buttons or the clickfingers with gnome-tweaks.
  • Pavel
    Pavel almost 6 years
    @PatKilg Yes, I already had the synaptics driver installed although I didn't do it manually. Perhaps carried over from previous version upgrades.
  • Vectornaut
    Vectornaut over 5 years
    I had the same problem on the same machine as the OP. Like @Pavel, I had the Synaptics driver installed without knowing it. Once I got rid of the offending driver, by removing the package xserver-xorg-input-synaptics, this solution worked like a charm!
  • Mihai Todor
    Mihai Todor almost 5 years
    PS: Don't run this gsettings command using sudo by accident or it won't work.
  • PatKilg
    PatKilg almost 5 years
    @MihaiTodor I suggest never running a commands with sudo unless you have a very good reason ;-)
  • Mihai Todor
    Mihai Todor almost 5 years
    Yeah, bad things can happen when setting up a new system and you're in a rush :)
  • NIMISHAN
    NIMISHAN about 4 years
    Package gnome-tweak-tool is not available, but is referred to by another package.
  • PatKilg
    PatKilg almost 4 years
    This answer is scoped to Ubuntu 18.04. I suspect recent viewers are finding this after upgrading Ubuntu to 20.04. The command line fix should still work, but check out this post for gnome-tweak installation instructions: itsubuntu.com/install-gnome-tweak-tool-on-ubuntu-20-04
  • Tom Rhodes
    Tom Rhodes over 3 years
    In 18.04 I had no problems with this, just updated to 20.04.1 LTS and now secondary/right clicks are REALLY problematic, intermittent and difficult to get constantly. I can't see how to map the secondary stylus button to one of the buttons on my CTH-480 wacom and I can't see how to affect the sensitivity to correct this either. I can map a key combination to a physical button but I can't assign a right/secondary click. big problem...