2

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
  • 161
  • Offhand, actions that happens on swipes can be controlled with this extension, so you can just disable a gesture given. – Hi-Angel May 03 '20 at 11:44
  • Thank you for the suggestion, but the site says it does not work on ubuntu 20.04 – D Songwriter May 03 '20 at 12:06
  • This is odd, there is nothing special about Ubuntu 20.04. Could you perhaps be referring to the We cannot detect a running copy of GNOME warning? In that case this is just because you would need an extension in browser for this to work. But you can without it though by manually downloading the file. though that would require a bit more work. – Hi-Angel May 03 '20 at 12:24
  • Oh, I also found this, might be worth giving a try too https://extensions.gnome.org/extension/1140/disable-gestures/ – Hi-Angel May 03 '20 at 12:28
  • If you execute a command gsettings list-recursively org.gnome.desktop.peripherals.touchpad do you see any setting related to the gestures? – Hi-Angel May 03 '20 at 12:53
  • Okay, I figured a touchpad on one my laptop supports gestures, so I looked, and I don't see any values at org.gnome.desktop.peripherals.touchpad nor xinput related to gestures. It is interesting that your question seems to be a popular one, however nobody ever asked for an RFE gnome developers. I'd suggest you to do so. – Hi-Angel May 03 '20 at 13:18
  • My touchpad list doesn't refer to gestures either... odd thing is it says tap-to-click false.. and click-method 'fingers'... tap to click does work on the Logitech K400+ – D Songwriter May 03 '20 at 13:52
  • On testing inputs.. I have learned a few things... The zoom command is seen as a keyboard command, even though I am using the touchpad. The pinch/zoom on the touchpad is seen exactly as a two finger scroll with the left control held. I was hoping to find a "key" and be able to re-assign with xmodmap.. but it does not send it as a key... it sends the left control as well as the touchpad movement so that route would not work... I tried assigning the left control to right control.. but that did not disable it either. – D Songwriter May 03 '20 at 13:56
  • I tried editing the /lib/udev/hwdb.d/60-keyboard.hwdb and commenting out lines that said zoomin and zoomout in the Logitech section under the evdev input with the number closest to the Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver number. Then did # systemd-hwdb update and rebooted. Initially I was excited thinking I had solved it... I was looking at a Google sheet in chrome (where I am keeping notes on what I've tried) and it did not zoom from the touchpad... must just be a google sheets thing... other webpages in chrome.. and firefox and Brave browsers still zoom. – D Songwriter May 03 '20 at 14:01
  • Okay, so, I'm a bit confused now. The question is: are these gestures generated by libinput or the keyboard itself. Please, execute libinput debug-events and evemu-record commands, and compare their outputs. If there are GESTURE_* events in the former, but nothing similar in the latter, that means libinput generates pinches, not the keyboard itself. – Hi-Angel May 03 '20 at 14:05
  • I did xmodmap -pk > xmodmapkeys.txt and searched the file.. there is no entry for zoom or pinch, so no way to use xmodmap to fix the trouble that I can see. So looking at other things. I will look at getting a sign in and posting it on the Gnome issues. Thank you for the suggestion. I didn't find anything on pinch or zoom related to touchpad issues on a search there. – D Songwriter May 03 '20 at 14:08
  • That's what has confused me also.. I get events doing either sudo evtest /dev/input/event4 or xinput test id and libinput record.. none of them mention "gesture" "zoom" or "pinch" They all show a combination of the left control (maybe sometimes the right control) and the location/mouse type movement of the touchpad. – D Songwriter May 03 '20 at 14:26
  • evtest results for a pinch/zoom: Event: time 1588515946.341623, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1588515946.341623, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1 Event: time 1588515946.341623, -------------- SYN_REPORT ------------ Event: time 1588515946.347617, type 2 (EV_REL), code 8 (REL_WHEEL), value -1 Event: time 1588515946.347617, -------------- SYN_REPORT ------------ Event: time 1588515946.355614, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1588515946.355614, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL).... – D Songwriter May 03 '20 at 14:29

2 Answers2

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
  • 3,702
  • 1
  • 29
  • 36
  • Would disabling gestures (not sure how to build that libinput).. disable the two finger scroll also? – D Songwriter May 03 '20 at 14:34
  • No, the comment in the code referred specifically mentions this excludes 2-finger scroll. But FWIW, I've read your last comments, it doesn't seem to be clear if what you're seeing are gestures generated by libinput or some odd behavior of your keyboard (i.e. because libinput wouldn't generate Ctrl keycode while you're using touchpad, this is too error-prone). In that case it's still worth creating a report to libinput, so perhaps they could create some workaround for these keyboards (they have quirks for various buggy devices, these keyboards may be one of them). – Hi-Angel May 03 '20 at 15:35
  • The extended gestures link says it is for Wayland, I show I am running X11.. so I am guessing that would not work? I'm switching my keyboards...using the problem one on an older system running ubuntu 18.04.. if that or the disable gestures option you mentioned would not work.. can you guide me how to do the libinput change? – D Songwriter May 03 '20 at 21:04
  • Regarding building libinput, you can refer to this comment. It's worth noting that I was told on IRC that libinput gestures do not work on X11, so that adds up some concerns. I think right now best way for you to move forward would be to follow the advice from my previous comment. That is, create a bugreport against libinput, and attach the records as advised by the docs. Because right now it's unclear whether your problem is even related to libinput gestures. I'd be curious to follow the report too. – Hi-Angel May 03 '20 at 21:17
  • I did submit that libinput bug earlier today. Thank you for your time and suggestions. – D Songwriter May 03 '20 at 22:55
  • @DSongwriter oh, it's this one, I see. If it turns out these were not libinput gestures but rather oddly behaving keyboards, I think it might be worth if you post an answer about that and move ✓ checkmark there. No worries here, I'll even upvote you, you did a great research. – Hi-Angel May 03 '20 at 23:29
  • libinput responded as follows: "we've never reverse-engineered the k400 (if there is anything to reverse-engineer, there might not be) so all the touchpad stuff is done in the firmware. the touchpad looks like a mouse, scrolling is sent as mouse wheel events, etc. libinput can't do anything here, we just take the events and pass them on as-is." This agrees with my testing.. the keyboard is sending bad/false information. The K400+ model is not ready for prime time with ubuntu. I have an older K400r which does not have those same troubles. – D Songwriter May 10 '20 at 22:38
  • Yeah, I've seen it, I subscribed to the bug. Well, they say that it's purely a hardware problem, and they don't know any workaround which could be implemented in libinput for this. This is an answer too, even if not the one you'd want. You may want to post it since someone else might stumble upon the same problem and they may not read the comments (or the comments may not be available for whatever reason) "The K400+ model is not ready for prime time with ubuntu" — I'd argue it's not ready for any operating system, since the problem is with the keyboard per se – Hi-Angel May 10 '20 at 22:42