Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I would like to change the mapping of my touchpad (of an eee-pc with Linux Mint 16 MATE edition) so that a two fingers tap is a middle click and three is right click.

For that I add the ButtonMapping option to /usr/share/X11/xorg.conf.d/50-synaptics.conf:

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
      MatchDevicePath "/dev/input/event*"
        Option "ButtonMapping" "1 3 2 4 5"

But it has no effect.

This xinput command does work, but is lost on reset (and it doesn't work in ~/.xinitrc or other init scripts I've tried):

xinput set-button-map "ETPS/2 Elantech Touchpad" 1 3 2 4 5

Update: xclip is not actually what I want as it changes also the physical keys. However it did work in the MATE startup applications. The following doesn't, but does what I want when manually executed:

synclient TapButton2=2
synclient TapButton3=3
share|improve this question

2 Answers 2

Idea #1 - gnome-session-proerties

Depending on how you'd like to solve this I can think of one way which should "just work". I would create an application that runs when you login and add a shell script to this list that runs this particular command. This will enforce the running of this any time you login.


xinput set-button-map "ETPS/2 Elantech Touchpad" 1 3 2 4 5

Then add this script to the "Startup Applications Preferences" dialog in GNOME.

$ gnome-session-properties

                       ss #1

After adding an item to this dialog make sure that it's checked so that it'll run during logins.

Idea #2 - Adding options to 50-synaptics.conf

Since you're dealing with a Synaptic touchpad you could add the following to your "Xorg.conf.d" directory. This is right from the synaptic man page. This is boilerplate for a InputDevice rule you could add.

   Section "InputDevice"
     Identifier "devname"
     Driver "synaptics"
     Option "Device"   "devpath"
     Option "Path"     "path"

Again from the man page are the following options you could use:

   Option "TapButton2" "integer"
          Which mouse button is reported on a non-corner two-finger tap.  Set 
          to 0 to disable. Property: "Synaptics Tap Action"

   Option "TapButton3" "integer"
          Which mouse button is reported on a non-corner three-finger tap.  
          Set to 0 to disable. Property: "Synaptics Tap Action"

So putting it all together you could do something like this to the file: /usr/share/X11/xorg.conf.d/50-synaptics.conf:

Section "InputClass"
        Identifier "Switch key mappings"
        MatchDriver "synaptic"
        Option "TapButton2" "2"
        Option "TapButton3" "3"

Also I think I would add this stanza to its own file under /etc/X11/xorg.conf.d/50-synaptics.conf instead. This directory is meant for overriding or appending additional customizations. That way if you do a system update your changes will not be impacted if the file under /usr/share/X11 are touched.

share|improve this answer
Unfortunately this is not working. Don't really understand why. – Zah Apr 17 '14 at 13:11
@Zah - what version of Linux is this? There are other ways to do the above but they quickly devolve into a multitude of ways. – slm Apr 17 '14 at 14:35
Please see update. – Zah Apr 18 '14 at 12:05
@Zah - see updates. – slm Apr 18 '14 at 12:56
Not working.... guess something is overriding the conf. Also tried calling the file /etc/X11/xorg.conf.d/999-synaptics.conf – Zah Apr 19 '14 at 10:46

Combining the two methods described above - physical and virtual remaps- , I can now map the two mouse buttons below my touch pad to back/forward while keeping tapping buttons intact.

If anyone is interested in how, here's how:

  • I remap the buttons of my touchpad, switching 1 and 3 with 8 and 9, respectively. (That is, switching left and right click with back and forward click.) This makes the buttons below the touchpad behave like back and forward buttons, but also makes tapping go back and forth instead of clicking.

    % xinput set-button-map touchpad 8 2 9 4 5 6 7 1 3
  • I therefore also tell synaptic to use my new 8th and 9th button (i.e. button 1 and 3) for single and double tapping.

    Section "InputDevice"
        Identifier "touchpad"
        Driver "synaptic"
        Option "TapButton1" "8"
        Option "TapButton2" "9"
        Option "TapButton3" "2" # I like middle click on three finger clicking
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.