23

The Thinkpad T480s has a "clickpad": a touchpad where (parts of) the touchpad itself is pressable instead of having physical dedicated buttons.

Running X.org 7.7, there is a horizontal stripe at the bottom of the touchpad that acts as the mouse buttons 1, 2, and 3 (i.e. left, middle and right); basically it looks like this:

+-----------------+
|                 |
|                 |
|                 |
|                 |
|11111 22222 33333|
|11111 22222 33333|
+-----------------+

How do I disable button 2 and reallocate that area to between buttons 1 and 3? I.e. I would like the following layout:

+-----------------+
|                 |
|                 |
|                 |
|                 |
|11111111 33333333|
|11111111 33333333|
+-----------------+

Note this question is different from mtrack: how to get vertical button zones? since I am trying to do this in the context of XInput, not mtrack. Also, the hardware is not Synaptics.

The hardware in question is identified by XInput as

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=11   [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech TrackPoint                id=12   [slave  pointer  (2)]
Cactus
  • 805
  • 3
  • 9
  • 18
  • hi i also want to make it `1111 3333` equally currently i get is `1111 1133` . any idea how you solved it – Santhosh May 23 '22 at 05:48
  • All the solutions listed here are for Xorg. For wayland, [some solutions here.](https://unix.stackexchange.com/questions/326373/configure-extra-mouse-button-as-a-second-middle-click-under-wayland) – Samuel-Zacharie Faure Jun 06 '23 at 21:30

4 Answers4

12

If I type:

$ xinput get-button-map 'DLL07BF:01 06CB:7A13 Touchpad'

I get: 1 2 3 4 5 6 7

I tried using:

$ xinput set-button-map 13 1 2 0 4 5 6 7

It disabled middle and right click.

slm
  • 363,520
  • 117
  • 767
  • 871
Robert
  • 121
  • 1
  • 2
  • 5
    type `xinput list` for a list of devices if you don't know your touchpad name by heart – Kerem Dec 09 '19 at 14:12
  • 1
    If you prefer a more "visual" solution, install **GNOME Tweaks**, open it, go to the _Keyboards & Mouse_ tab, then in the _Mouse Click Emulation_ section click the option _Fingers_. Optionally if you also want to disable the middle click for pasting in the console (at least for me is really annoying), in the same tab disable _Middle Click Paste_. – Mariano Ruiz Nov 05 '21 at 12:31
9

You can easily get that middle 'button' to stop registering with a command like this:

xinput set-button-map 11 1 2 0 4 5 6 7 8 9 10 11 12

The first argument here specifies the device ID (in this case 11 based on your above posted output from xinput), while the rest map buttons to functions. The first two are the left and right buttons (with 1 and 2 being a regular click and the context menu), the third is the middle button (normally it would be set as 3, but 0 tells xinput to map it to nothing), while the rest cover other things (scrolling, etc).

Adjusting the other two buttons to cover the whole bottom of the pad is a bit trickier, and may actually not be possible. Clickpads like this one work by having a single switch under the pad that triggers the click, and then watching where the finger is on the pad to determine which button to register it as. There are three different ways this might be handled:

  1. In the firmware of the pad itself, without configuration options.
  2. In the firmware of the pad itself, with configuration options.
  3. In the userspace part of the driver.

The second method is only ever the case if the device is not connected over an old PS/2 style serial connection (yours probably is connected this way, most Thinkpads are like this). Synaptics does this using method 3, and offers lots of config options for almost everything. I'm not sure how Elantech handles it, but I would guess it's probably the first case unless it's a USB or I2C connected device, in which case it's technically the third even though I'm pretty sure they have no special input driver for X.

Austin Hemmelgarn
  • 11,401
  • 1
  • 24
  • 42
  • 4
    On my ThinkPad A485, running `xinput get-button-map` gives me 1 through 7 in ascending order. When I changed the third digit to 0, my right click was disabled, not the middle click. In my case the second digit was the middle click. However, I didn't set it to 0, but to 1, so now I don't have a dead space but rather an extended left click ;-) – comfreak Jan 12 '19 at 08:40
  • @comfreak Came to this post 2 and a bit years later, and the exact same for my Legion Y470S. also had 1 - 7 as my xinput, and 2 was my middle click, so setting it to 1 gives me the extended left click. +1 for you! – Chris S Apr 29 '21 at 22:57
9

Once you've figured out which number corresponds to which button, you can replace middle-click with right-click.

In my case, the second number mapped to middle-click:

1 2 3 4 5 6 7
  ^

So this replaces it with left-click:

xinput set-button-map x 1 1 3 4 5 6 7

Where x is the id obtained from xinput

Adam Smith
  • 191
  • 1
  • 2
  • 1
    This worked the best for me - if the sequence is 1 0 3 etc then there is a a dead area of the touchpad! So mapping middle-click to left-click is very sensible, thanks. – drkvogel Dec 07 '21 at 23:27
  • This is perfect -- it just maps the middle section of the trackpad to left-click. This way you get a 2/3 width left click, and a 1/3 width right click (all the way in the right corner) which matches expectations. thanks! – trisweb Mar 14 '23 at 18:45
6

Looks like order of buttons is Left Middle Right there. This worked for me.

xinput set-button-map 11 1 0 3 4 5 6 7
user3123523
  • 61
  • 1
  • 1