Palm detection not working properly

Hi. I’m on KDE and wayland. I’m having trouble with palm recognition. I have “disable while typing” enabled on system settings. However, it still happens frequently that I get random clicks shortly after typing, many times just before I start typing again, which makes the text I’m typing appear somewhere else in the editor, not where I wanted. It seems palm recognition isn’t working properly. Do you know how to debug? Or how to configure libinput so that my palms don’t generate clicks in the interval between writing one idea and the next?

Another option that could work is to disable “tap to click” in the virtual desktop where I use the editor. Is that possible in KDE?

Yet another idea I have is that the keyboard shortcut that I use to change to the second virtual desktop (where I have my editor) would be also bound to the action of disabling “tap to click”. Is it possible in KDE to have one keyboard shortcut bound to two actions at the same time? Also, is the action of disabling “tap to click” in the touchpad section of system settings available for a keyboard shortcut?

Any help in any of these directions would be much appreciated.

There’s some progress in the second and third fronts. I can use the command

qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/event8 Set org.kde.KWin.InputDevice tapToClick false

to disable “tap to click” and

qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/event8 Set org.kde.KWin.InputDevice tapToClick true

to enable it back again.

@rhz ,
Why don’t you use custom shortcuts for touchpad control?

With ydotool you can make keyboard sequences in a script:
I set up ydotool like this

Because I don’t want to disable the touchpad, only the tap to click behaviour.

At first I thought ydotool could help me have multiple actions bound to the same keyboard shortcut, but it isn’t for that. It seems it’d only be useful if I wanted to disable the touchpad completely, but that’s not my goal.

But in wayland touchpad Tap-to-click uncheck seems to be effective.


I probably misunderstood something.

As for ydotool keypresses and mouse events can be scripted:
https://gabrielstaples.com/ydotool-tutorial/#gsc.tab=0

Yes, unchecking Tap-to-click in system settings is effective, but it is global. I want the setting to be disabled only in the virtual desktop where I have the editor.

There’s more progress to report on the second and third fronts. I wrote the following bash script that allows to toggle the Tap-to-click setting.

#!/bin/bash

touchpad=$(udevadm info -q name /dev/input/by-path/platform-AMDI0010\:02-event-mouse)
touchpad=${touchpad#input/}
ttc=$(qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/"$touchpad" Get org.kde.KWin.InputDevice tapToClick)
if [ "$1" = "toggle" ]; then
  if [ "$ttc" = "true" ]; then
    qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/"$touchpad" Set org.kde.KWin.InputDevice tapToClick false
  else
    qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/"$touchpad" Set org.kde.KWin.InputDevice tapToClick true
  fi
else
  qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/"$touchpad" Set org.kde.KWin.InputDevice tapToClick "$1"
fi

To make it work in a different machine, you’d have to find a stable symlink to the one I found for my machine and replace the /dev/input/by-path/platform-AMDI0010\:02-event-mouse.

Now I can bind this script to a keyboard shortcut on system settings. That’s very very close to what I want. The next thing would be to call this command automatically when I switch to virtual desktop “editor” and when I switch from this virtual desktop to any other. Got to find how to switch virtual desktops using qdbus6.

Found it! It is qdbus6 org.kde.KWin /KWin org.kde.KWin.setCurrentDesktop 1. Now I can write scripts like

#!/bin/bash

tap-to-click true
qdbus6 org.kde.KWin /KWin org.kde.KWin.setCurrentDesktop 1

The only thing I can suggest a script periodically check the active window with
kdotool
and to enable touchpad only if it is not in your editor.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.