Score:0

How do I simulate a mouse click by applying pressure on the touchpad?

vg flag

I was wondering if it was possible to click the mouse without really clicking by applying a certain amount of pressure on the touchpad. I understand that we can detect the pressure of a touch with libinput or evdev but how do I use these to trigger a mouse event? I suppose a very naive approach would be to run a loop that detects the touch pressure and if it crosses a certain level, use xdotool to create a mouse click event. Is there a better way of doing this and if so, how do I go about it?

it flag
You can enable "Tap to Click" functionality on your trackpad, which would mean if you tap it, it creates click inputs. Do you have a different goal in mind?
st0n3r avatar
vg flag
@earthmeLon I apologise for the poorly worded question. What I meant was, while I'm moving my finger across the trackpad, if the pressure ever crosses a certain pressure value, I want it to trigger a click. I already have tap to click enabled. The way it works right now, while I'm moving my finger across the trackpad, if I want to click something I have to lift my finger and then tap. I'd like to skip the lift and tap bit.
kanehekili avatar
zw flag
Very efficient request. But that feature would have to be realized on the driver level, otherwise its behaviour would be too sluggish. And it depends on your hardware (aka touchpad) whether it provides "pressure" data. The [libinput library](https://manpages.ubuntu.com/manpages/bionic/man1/libinput-measure-touchpad-pressure.1.html) can be used for evaluating this
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.