0

In Windows, I can configure the actions for the Synaptics TouchPad (and TouchStyk) hardware click buttons as I want. How can I do this in Kubuntu? There's no option for the touchpad buttons on the settings. I can only swap mouse buttons, and simulate clicks on the corners of the touchpad, which is not what I want. I want to change the right-click HARDWARE button below the touchpad to middle-click.

My notebook is a model like in this picture: HP EliteBook 850 G2. As you can see, there's 2 buttons above (for "TouchStyk" / trackpoint) and 2 buttons below (for the TouchPad). I want to change bottom-right button only, and keep the others.

How can I set this? Do I need to install something? And if it's not implemented, where should I post an issue report asking for this feature?

I ran this on the command-line, but I don't think it helps. There's Synaptics Click Action (338): 1, 1, 0, but info synaptics seems to indicate it's for a clickpad (mine is not a clickpad).
By the I way, I think the PS/2 Generic Mouse might be how it recognizes the "TouchStyk" (trackpoint) without a specific driver implementation for it. (But this is less relevant because the buttons I want to be able to change are mainly the ones below, the touchpad buttons).

$ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ [...]
⎜   ↳ PS/2 Generic Mouse                        id=17   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=18   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ [...]
$ xinput list-props 18
Device 'SynPS/2 Synaptics TouchPad':
        Device Enabled (165):   1
        Coordinate Transformation Matrix (167): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (298):     1
        Device Accel Constant Deceleration (299):       2.500000
        Device Accel Adaptive Deceleration (300):       1.000000
        Device Accel Velocity Scaling (301):    12.500000
        Synaptics Edges (321):  1661, 5367, 1412, 4510
        Synaptics Finger (322): 25, 30, 0
        Synaptics Tap Time (323):       180
        Synaptics Tap Move (324):       246
        Synaptics Tap Durations (325):  180, 180, 100
        Synaptics ClickPad (326):       0
        Synaptics Middle Button Timeout (327):  75
        Synaptics Two-Finger Pressure (328):    282
        Synaptics Two-Finger Width (329):       7
        Synaptics Scrolling Distance (330):     112, 112
        Synaptics Edge Scrolling (331): 0, 1, 0
        Synaptics Two-Finger Scrolling (332):   1, 0
        Synaptics Move Speed (333):     1.000000, 1.750000, 0.035619, 0.000000
        Synaptics Off (334):    0
        Synaptics Locked Drags (335):   1
        Synaptics Locked Drags Timeout (336):   250
        Synaptics Tap Action (337):     0, 0, 0, 0, 1, 2, 0
        Synaptics Click Action (338):   1, 1, 0
        Synaptics Circular Scrolling (339):     0
        Synaptics Circular Scrolling Distance (340):    0.100007
        Synaptics Circular Scrolling Trigger (341):     0
        Synaptics Circular Pad (342):   0
        Synaptics Palm Detection (343): 0
        Synaptics Palm Dimensions (344):        10, 200
        Synaptics Coasting Speed (345): 1.000000, 50.000000
        Synaptics Pressure Motion (346):        30, 225
        Synaptics Pressure Motion Factor (347): 1.000000, 2.000000
        Synaptics Resolution Detect (348):      1
        Synaptics Grab Event Device (349):      0
        Synaptics Gestures (350):       1
        Synaptics Capabilities (351):   1, 0, 1, 1, 1, 1, 1
        Synaptics Pad Resolution (352): 70, 43
        Synaptics Area (353):   0, 0, 0, 0
        Synaptics Noise Cancellation (354):     28, 28
        Device Product ID (291):        2, 7
        Device Node (290):      "/dev/input/event7"
$ synclient -l
Parameter settings:
    LeftEdge                = 1661
    RightEdge               = 5367
    TopEdge                 = 1412
    BottomEdge              = 4510
    FingerLow               = 25
    FingerHigh              = 30
    MaxTapTime              = 180
    MaxTapMove              = 246
    MaxDoubleTapTime        = 180
    SingleTapTimeout        = 180
    ClickTime               = 100
    EmulateMidButtonTime    = 75
    EmulateTwoFingerMinZ    = 282
    EmulateTwoFingerMinW    = 7
    VertScrollDelta         = 112
    HorizScrollDelta        = 112
    VertEdgeScroll          = 0
    HorizEdgeScroll         = 1
    CornerCoasting          = 0
    VertTwoFingerScroll     = 1
    HorizTwoFingerScroll    = 0
    MinSpeed                = 1
    MaxSpeed                = 1.75
    AccelFactor             = 0.0356189
    TouchpadOff             = 0
    LockedDrags             = 1
    LockedDragTimeout       = 250
    RTCornerButton          = 0
    RBCornerButton          = 0
    LTCornerButton          = 0
    LBCornerButton          = 0
    TapButton1              = 1
    TapButton2              = 2
    TapButton3              = 0
    ClickFinger1            = 1
    ClickFinger2            = 1
    ClickFinger3            = 0
    CircularScrolling       = 0
    CircScrollDelta         = 0.100007
    CircScrollTrigger       = 0
    CircularPad             = 0
    PalmDetect              = 0
    PalmMinWidth            = 10
    PalmMinZ                = 200
    CoastingSpeed           = 1
    CoastingFriction        = 50
    PressureMotionMinZ      = 30
    PressureMotionMaxZ      = 225
    PressureMotionMinFactor = 1
    PressureMotionMaxFactor = 2
    ResolutionDetect        = 1
    GrabEventDevice         = 0
    TapAndDragGesture       = 1
    AreaLeftEdge            = 0
    AreaRightEdge           = 0
    AreaTopEdge             = 0
    AreaBottomEdge          = 0
    HorizHysteresis         = 28
    VertHysteresis          = 28
    ClickPad                = 0
$ apt list *input* --installed 
Listing... Pronto
inputattach/focal,now 1:1.7.0-1 amd64 [installed,automatic]
libinput-bin/focal-updates,now 1.15.5-1ubuntu0.2 amd64 [installed,automatic]
libinput10/focal-updates,now 1.15.5-1ubuntu0.2 amd64 [installed,automatic]
libqt5hunspellinputmethod5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libxcb-xinput0/focal,now 1.14-2 amd64 [installed,automatic]
xinput/focal,now 1.6.3-1 amd64 [installed,automatic]
xserver-xorg-input-all/focal,now 1:7.7+19ubuntu14 amd64 [installed,automatic]
xserver-xorg-input-libinput/focal,now 0.29.0-1 amd64 [installed,automatic]
xserver-xorg-input-synaptics/focal,now 1.9.1-1ubuntu3 amd64 [installed]
xserver-xorg-input-wacom/focal,now 1:0.39.0-0ubuntu1 amd64 [installed,automatic]
7
  • Oddly, you have lots of properties with Synaptics prefix. Unless I misunderstand, you either have an absolutely ancient Kubuntu, or you mistook synaptics for a driver, which is not uncommon source of confusion, and replaced libinput.
    – Hi-Angel
    Mar 5, 2021 at 22:02
  • But more to the point: why not to have both right-click and middle click at the same time instead of just the middle click? By any occasion, do you perhaps not know you can do middle-clicks α) with a 3-finger tap, or β) with by clicking the left and right touchpad buttons simultaneously? (α needs tap-to-click enabled, β needs libinput Middle Emulation Enabled). Btw, the recently released libinput 1.17 even has ability to do tap-and-drag for α-way.
    – Hi-Angel
    Mar 5, 2021 at 22:05
  • Sorry btw if it's really what you want, I didn't mean to annoy you. it's just that you didn't mention your motivation behind remapping, so I have to consider it could be an XY problem. (the answer to the remapping per se I don't know offhand).
    – Hi-Angel
    Mar 5, 2021 at 22:23
  • Because I've been used to that from Windows. Also, I don't like 2-finger tap for middle-click because the risk of accidentally clicking 1-finger left-click instead is WAY TOO DANGEROUS. Same applies for simultaneous buttons. Middle-click is often used for closing tabs, open links in BG etc.
    – geekley
    Mar 6, 2021 at 2:07
  • @Hi-Angel As you can see in the end of logs, I did manually install xserver-xorg-input-synaptics, because it gave me more options in system settings, like being able to tap to click. My Kubuntu is 20.04 LTS, so it's not too old.
    – geekley
    Mar 6, 2021 at 2:08

1 Answer 1

1

Instructions are taken from this article. You can remap buttons with xinput set-button-map.

Amusingly, the article claims this should work on Wayland as well, except the button map may be different, so you'd need to reconfigure it. Also, note that result of this command will only work till you reboot, so you need to add the command to autostart. Though, on X11 you can alternatively set up that with X11 config files, but IMO they're too complicated, so my recommendation is: just add the command to autostart.

And lastly, please, do not use xinput with numeric identifiers as you do in your post. Those may be different from reboot to reboot, so at some point you may end up setting properties on the wrong device. Use instead string identifier as I do below.

For consistency I'll be using examples from my system.

First, list devices, and find which one is your touchpad:

 λ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ A4TECH USB Device Consumer Control        id=15   [slave  pointer  (2)]
⎜   ↳ A4TECH USB Device                         id=16   [slave  pointer  (2)]
⎜   ↳ DELL0768:00 06CB:7E92 Mouse               id=18   [slave  pointer  (2)]
⎜   ↳ DELL0768:00 06CB:7E92 Touchpad            id=19   [slave  pointer  (2)]
⎜   ↳ Microsoft Wired Keyboard 600 Consumer Control     id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ A4TECH USB Device Keyboard                id=13   [slave  keyboard (3)]
    ↳ A4TECH USB Device System Control          id=14   [slave  keyboard (3)]
    ↳ Integrated_Webcam_HD: Integrate           id=17   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=20   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=21   [slave  keyboard (3)]
    ↳ DELL Wireless hotkeys                     id=22   [slave  keyboard (3)]
    ↳ A4TECH USB Device Consumer Control        id=24   [slave  keyboard (3)]
    ↳ Microsoft Wired Keyboard 600              id=10   [slave  keyboard (3)]
    ↳ Microsoft Wired Keyboard 600 Consumer Control     id=12   [slave  keyboard (3)]
    ↳ Microsoft Wired Keyboard 600 System Control       id=23   [slave  keyboard (3)]

The touchpad here is DELL0768:00 06CB:7E92 Touchpad. Now, let's look its button map:

 λ xinput get-button-map "DELL0768:00 06CB:7E92 Touchpad"
1 2 3 4 5 6 7

Per my understanding, the meaning of the indices may vary. To find what buttons maps to what index you'll have to execute xev app, and to try pressing buttons on your touchpad. Example:

 λ xev
[…]
ButtonRelease event, serial 35, synthetic NO, window 0x5c00001,
    root 0x7ba, subw 0x0, time 1191093641, (148,284), root:(1110,286),
    state 0x210, button 2, same_screen YES

ButtonPress event, serial 35, synthetic NO, window 0x5c00001,
    root 0x7ba, subw 0x0, time 1191096033, (148,284), root:(1110,286),
    state 0x10, button 3, same_screen YES

ButtonRelease event, serial 35, synthetic NO, window 0x5c00001,
    root 0x7ba, subw 0x0, time 1191096294, (148,284), root:(1110,286),
    state 0x410, button 3, same_screen YES
[…]

Here you can see button 2 and button 3 are the indices. These events were triggered by me pressing middle and right touchpad buttons (to be clear: I don't have a hw touchpad middle-button, instead I was pressing left and right buttons simultaneously. Also fun fact, it is a clickpad, so… yeah, it works for clickpads too in case anyone is wondering).

So, now you may permute the buttons:

 λ xinput set-button-map "DELL0768:00 06CB:7E92 Touchpad" 1 3 2 4 5 6 7

Voilà! Now whenever I press right button on the touchpad, I get a middle-button event instead. You can even set, let's say, a 1 2 2 4 5 6 7 (the repeating 2s), so there would be no way to trigger right-click with the touchpad.

7
  • THANKS!! I worked great! I did xinput set-button-map 'SynPS/2 Synaptics TouchPad' 1 3 2 4 5 6 7 8 9 10 11 12. And indeed the TouchStyk is being recognized as generic mouse, because I did xinput set-button-map 'PS/2 Generic Mouse' 8 2 3 4 5 6 7 and it worked! Now not only I can set middle-click on the button, but I can use "go-back" mouse button as well as the extra 4th button! YAY! I thought that might mess up my wireless mouse, but it didn't!
    – geekley
    Mar 6, 2021 at 16:54
  • @geekley btw, this trackpoint being detected as a "Generic Mouse" is not normal. You might try latest stable kernel to see if it makes any difference. Also, trackpoints require quite complicated acceleration algorithm, see this article. Which is to the point about not using xf86-synaptics mentioned in the other comments thread, because xf86-synaptics sure doesn't have such good algo. Although, it might not matter till trackpoint is detected properly.
    – Hi-Angel
    Mar 6, 2021 at 18:26
  • Well I dont really use the trackpoint, just the buttons. In fact, it took me a while to realize they were for the trackpoint, because I just saw them as "extra buttons above touchpad" (see picture). My kernel is 5.4.0-66-generic, so I think it's not old. Do you mean I should try uninstalling xserver-xorg-input-synaptics? I installed it only because I think I needed it for enabling tap-to-click in Kubuntu settings (it added lots of options). It was installed in live-usb version of Kubuntu 20.04, so I added it after OS installation too.
    – geekley
    Mar 6, 2021 at 18:34
  • @geekley do you have a xserver-xorg-input-libinput installed? I can't really check it myself (I use Archlinux and my gf is using Fedora, Ubuntu I only have in a podman container for work), but I assume if you remove xserver-xorg-input-synaptics and install a xserver-xorg-input-libinput, you might still have the tap-to-click option. Either way, I can assure you there is some way to make it work, because no-one cares about xf86-synaptics these days, IOW sure KDE should be ok with libinput. I just don't really have a system to experiment to figure out what packages exactly are needed.
    – Hi-Angel
    Mar 6, 2021 at 18:42
  • 1
    @geekley this is a good question. I don't really know where to report wrong detection, so I googled around… This (old) article seems to imply detection is determined solely by kernel. Then there's also this reply implying you can do something through hwdb (provided by systemd). Not much, but I hope this helps. Might even be that latest upstream hwdb has some rule for your touchpad.
    – Hi-Angel
    Mar 6, 2021 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .