5

I am using an Intel NUC with Ubuntu 20.04. It is mainly used as an HTPC and to browse the web. I want to use a wireless keyboard with built in touchpad. I have tried two, each has similar problems. The Logitech K400+ likes to automatically zoom when I'm using two finger scroll. It often works fine, but periodically zooms in. A similar keyboard by 1byOne does better about not zooming but it likes to enter mouse cursor movements as swipes.. which takes me to another application or the desktop.

I've been reading for days on xinput and libinput. Device list-props doesn't show anything which would clearly be zoom or pinch or swipe functions.

I would like to find where in linux it processes the inputs from the touchpad and have it ignore those functions (I use the ctrl-shift-+ and - to zoom in and out.. don't want the touchpad doing it).

I've read about changing to synaptics, but found nothing it its documentation which would answer my question either.

BenMorel
  • 173

3 Answers3

1

The problem are the keyboards themselves. See answer from libinput for further information. Basically, the keyboards do not have proper error detection and send signals to the system the user does not intend. At this time there is not an easy way to turn off gestures.

0

As of writing these words, grepping through libinput code shows there's only one assignment to gesture.enabled, in function tp_init_gesture, which is basically "if we can do gestures with that touchpad reliably, let's do them". So libinput doesn't allow to disable them.

Theoretically it should be possible to intercept event before getting to applications with gnome-shell, but there doesn't seem to be any "official" way to do that, so if extensions listed in comments didn't help you, seems you're out of luck here. You can create an RFE for gnome-shell to support that functional

Workaround

As a hacky workaround you can build libinput yourself, and replace the line I referred

    tp->gesture.enabled = !tp->semi_mt && tp->num_slots > 1;

with

    tp->gesture.enabled = false;

that should disable gestures for you.


I asked on #gnome:gnome.org Matrix channel, and it's worth quoting Alexander Mikhaylenko

The Logitech K400+ likes to automatically zoom when I'm using two finger scroll. It often works fine, but periodically zooms in. A similar keyboard by 1byOne does better about not zooming but it likes to enter mouse cursor movements as swipes.. which takes me to another application or the desktop

they are generated by libinput

I know because I've implemented a few gestures

the hardware's job is to report touch positions

often it does it incorrectly

then libinput tries to fix it for that particular device

every time you see a bug like that, you report it to libinput

because its job is to normalize whatever cr*p the hardware is sending so that libinput users have proper events

in case it's impossible, libinput is also the component that would disable the gestures for that device

e.g. it does that for so-called semi-multitouch touchpads

basically, which send the number of fingers and bounding box instead of old positions, if you have a laptop from <2013 it probably has one unless it's a macbook

So you may want to report problems to libinput.

Hi-Angel
  • 4,810
0

The solution (workaround) I have been using since Ubuntu 16 still works for Ubuntu 24. My Control_L and Super_L are swapped. This immediately stopped the accidental zooming of web pages as the computer was interpreting them together. When previously, even the slightest movement towards the other finger during a 2 finger scroll would engage Left Control and start zooming.

  • Control_L next to Alt_L just makes sense on the K400

Remap to your liking, so Control_L is changed to something else.

You can swap with your favorite tweak tool. Or use the following...

I searched far and wide to see where I got this info. It looked too neat when I wrote it down, like it was from somewhere. Please let me know if these are your words, or I did actually do it nicely, as I have been trying to make my notes better.

Here's how to swap the Ctrl and Win keys in Ubuntu:

  • Open the terminal

Edit the X Keyboard Extension by typing (use your fav text editor... nano, gedit, pluma):

sudo nano /usr/share/X11/xkb/symbols/pc

Make the following changes to the file:

key <LCTL> { [ Super_L ] }
key <LWIN> { [ Control_L ] }
# And Optionally
#key <RCTL> { [ Super_R ] }
#key <RWIN> { [ Control_R ] }

Clear the xkb cache by typing

rm -rf /var/lib/xkb/*

Restart the computer if the keys aren't swapped.

  • With my Super now the pinch button, any time I scroll a lot the launcher pops up. So I just changed that in tweak tool to one of my top left special keys (don't use F2, it will engage the side gesture on the touchpad (Super_L in my case) lol).

Hope this helps new folks that love this keyboard as much as I do.