abstract :
- How to turn off the right button on ClickPad
- What are snippets for the X server?
- Few lyrics about how in Linux looking for solutions to problems.
Introduction
X-server in relation to iron, I usually causes hostility. Because, on the one hand, this is something terribly concise and covered with endless subtleties of supporting elite laptops of the next megazaran (Linus Loves Nvidia), which cannot do normal firewood under Windows, but on the other hand, this is what I want to work smoothly and very yourself, for repairing a broken X server is unpleasant, especially if it is the only working computer at hand.
However, from the lyrics to hardcore.
')
There is such a wonderful thing on x220:

In the middle of the keyboard is a branded IBM'ovskiy clitoris (trackpoint), under the keyboard (above the point) buttons from the trackpoint. The very point of the second set of buttons does not have and is ClickPad - under it there is one button, the click of which translates either to the left or right buttons depending on where the click was recorded. Processing this software (in the driver).
A long time ago (~ 2.6.30) in Linux, support for this thing was made by curved hacks, then thrown out (~ 2.6.38). As a result, many laptops (for example, the ugly HP, which I have at work) are left without a right mouse button at all.
Recently rolled up updates that "turned on" it. HP will probably be happy about this thing, however, on the X220, where there are clitoris hardware buttons with right (and middle) buttons, I was 100% satisfied that the clickpad works only as a left button.
After the update, I suffered a week, but I was not used to it. How can this bugfix turn off nafig and replace the bug? I clicked on the right all the time, expecting that it would be a left click (because the finger on the right and I still don’t want to move it).
Search
(instead of dull howto, I'd rather show you the process of finding a solution that not only solved the problem, but pumped me several small levels into linux).
So, the initial data: we know that this is called 'ClickPad' (nontrivial knowledge, by the way, nothing can be easily found without it), we know that this is due to the drivers of the dot, which are called psmouse.
The first iteration in Google led to the thought that psmouse had nothing to do with it (they cut out Clickpad support from it and did not cut it anymore).
The second was a search on ClickPad Linux, which showed firstly a wave of Linux users' love for vendors, and secondly, it hit the third keyword - synaptics (driver for points and the office that produces these points for these drivers).
... Which led to the man synaptics command.
synaptics is an xorg input driver . “Aha!” The men exclaimed. But the point is not in the core ... And in this mane, ClickPad was mentioned. Bingo? No, not bingo. Of course, no one began to read the whole man, and there was another entry into Google with a more specific set of words: ClickPad synaptics. Surprisingly, Google was extremely vague.
I had to still read man. ... Ok, not read, but search by ClickPad [Search in man, less, more, vim, etc. - '/', next 'n', previous 'N'].
I will quote the found section entirely:
Option "SoftButtonAreas" "RBL RBR RBT RBB MBL MBR MBT MBB"
This option is only available on ClickPad devices. Enable soft button click area support on ClickPad devices. The bottom four parameters are the bottom right
eters are the left, right, top, bottom of the middle button, respectively. If you want to touch the width or height, whichever applies. If any edge is set to 0, the button is assumed to
extend to infinity in the given direction. Setting all values to 0 disables soft button areas. Property: "Synaptics Soft Button Areas"
it seems, I thought sadly.
Why sad? Because all this is called xorg.conf, and its existence in the system was well described by xkcd's people:

If you have xorg.conf, then something in your life is not set ...
On the other hand, during the google process, I encountered the word xorg.conf.d several times.
[Reference: directories of the form "name conf.g" are usually used to divide the configuration file into many small ones, which allows each logical piece to be stored in a separate file, simplifying joint configuration management by the user and applications].
... A little more google, and, suddenly, I type:
$ find / usr -name "xorg.conf.d"
/usr/share/X11/xorg.conf.d
... and there are a bunch of scripts. Including the ill-fated SoftButtonAreas with the values of 50% and 82%, which makes this evil right button a radical extremist right source of social irritation.
A jigit can patch the /usr/share/X11/xorg.conf.d/50-synaptics file, but we are not jigits and we will go some other way.
Apparently, we can make the file in the same way, but in /etc/X11/xorg.conf.d/ (creating the directory first).
But how to write it?
Snippet xorg.conf
It turns out that in the 21st century, mankind has not only forgotten how to walk on the moon, but also invented snippets for the xorg.conf config. Which can be had and used even without the config itself. Read - a little more happiness in this life.
Each snippet allows you to change the behavior of the X-server in a particular case without inventing the entire config. Each snippet stores a section and an indication of what the section refers to. This is done by a bunch of options, among which we are interested in MatchDriver and MatchName. Our design will look something like this:
Section "InputClass"
Identifier "Kill right button off"
MatchDriver "synaptics"
MatchName "DUNNO"
Option "SoftButtonAreas" "0% 0 0% 0 0 0 0 0"
Endsection
We want to filter only the point of a specific brand (what and where).
What do we need to know?
MatchDriver - “synaptics”, approx. What's in MatchProduct? We read man xorg.conf:
MatchProduct "matchproduct"
This match can be used to check if the substring "matchproduct"
occurs in the device's product name.
... mdja
How to know device name
Guess: dmidecode?
Handle 0x0030, DMI type 21, 7 bytes
Built-in Pointing Device
Type: Track Point
Interface: PS / 2
Buttons: 3
Handle 0x0031, DMI type 21, 7 bytes
Built-in Pointing Device
Type: Touch Pad
Interface: PS / 2
Buttons: 2
Obviously sparsely. lspci does not roll, lsusb does not roll. Interface PS / 2 ...
In man'e to xorg.conf, Matchpnpid was mentioned. How to view pnp device identifiers in the system? Oops. I do not know. dmidecode just does not seem to. How? What? Where?
After some searching, a wonderful utility lspnp was found.
Alas, our point has a vague pnpid, which obviously cannot be used.
The next attempt is udev.
udev info --query=name --path=/dev/input/event0
Do not know this.
Dump the udev database? (
udevadm info --export-db
). That is still a pleasure.
... And if we ask the X server itself? After all, he has sooo detailed logs. Are looking for. We find.
[19.078] (II) config / udev: Adding input device SynPS / 2 Synaptics TouchPad (/ dev / input / event6)
[19.078] (**) SynPS / 2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
[19.078] (**) SynPS / 2 Synaptics TouchPad: Applying InputClass "touchpad catchall"
[19.078] (**) SynPS / 2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons"
[19.078] (II) LoadModule: "synaptics"
[19.078] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[19.078] (II) Module synaptics: vendor = "X.Org Foundation"
[19.078] compiled for 1.11.3, module version = 1.6.1
[19.078] Module class: X.Org XInput Driver
[19.079] ABI class: X.Org XInput driver, version 16.0
[19.079] (II) Using input driver 'synaptics' for 'SynPS / 2 Synaptics TouchPad'
[19.079] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[19.079] (**) SynPS / 2 Synaptics TouchPad: always reports core events
[19.079] (**) Option "Device" "/ dev / input / event6"
[19.080] (II) synaptics: SynPS / 2 Synaptics TouchPad: found clickpad property
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: x-axis range 1472 - 5472
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: y-axis range 1408 - 4448
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: pressure range 0 - 255
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: finger width range 0 - 15
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: buttons: left double triple
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: Vendor 0x2 Product 0x7
[19.080] (**) Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: touchpad found
[19.080] (**) SynPS / 2 Synaptics TouchPad: always reports core events
[19.080] (**) Option "config_info" "udev: / sys / devices / platform / i8042 / serio1 / input / input6 / event6"
[19.080] (II) XINPUT: Adding extended input device "SynPS / 2 Synaptics TouchPad" (type: TOUCHPAD, id 10)
[19.080] (**) synaptics: SynPS / 2 Synaptics TouchPad: (accel) MinSpeed is now constant deceleration 2.5
[19.080] (**) synaptics: SynPS / 2 Synaptics TouchPad: MaxSpeed is now 1.75
[19.080] (**) synaptics: SynPS / 2 Synaptics TouchPad: AccelFactor is now 0.040
[19.080] (**) SynPS / 2 Synaptics TouchPad: (accel) keeping acceleration scheme 1
[19.080] (**) SynPS / 2 Synaptics TouchPad: (accel) acceleration profile 1
[19.080] (**) SynPS / 2 Synaptics TouchPad: (accel) acceleration factor: 2.000
[19.080] (**) SynPS / 2 Synaptics TouchPad: (accel) acceleration threshold: 4
[19.080] (-) synaptics: SynPS / 2 Synaptics TouchPad: touchpad found
[19.081] (II) config / udev: Adding input device SynPS / 2 Synaptics TouchPad (/ dev / input / mouse0)
[19.081] (**) SynPS / 2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates"
Everything is straight text and written.
The name is SynPS / 2 Synaptics TouchPad.
Howto
We write the config:
/etc/X11/xorg.conf.d/1-kill-right-button-x220:
Section "InputClass"
Identifier "Kill right button off"
MatchDriver "synaptics"
MatchName "SynPS / 2 Synaptics TouchPad"
Option "SoftButtonAreas" "0% 0 0% 0 0 0 0 0"
Endsection
Restart the x-server (reboot) - and, voila, everything is working ... that is, it doesn't work as it should.