Input filter for blocking all touchpad clicks

I’ve installed Haiku on an old Thinkpad x131e Chromebook (which I previously corebooted). Runs fine. Unfortunately, my touchpad is physically broken and too easily produces clicks. It can be pushed down to click which is independent of tapping. I’d like to disable tapping as well. The notebook has a trackpoint with its own mouse keys, so there’s really no need for clicking via the touchpad. The Input preferences do not show any touchpad-specific settings (even though it does seem to be detected as a Synaptics according to syslog). And even if it did, I probably couldn’t disabling clicking altogether.
So I thought, why not write a simple input filter to ignore any B_MOUSE_DOWN of that particular device
However, it seems that B_MOUSE_DOWN doesn’t have any field allowing you to identify the originating device. Is that right?

Haiku version:

> uname -a
Haiku shredder 1 hrev54154+111 Jun  7 2020 07:16 x86_64 x86_64 Haiku

Here’s an interesting excerpt from the syslog. In this boot, the trackpoint is not detected (it usually is). Perhaps you can also see why the Synaptics is not detected as a proper touchpad (ie. why there are no touchpad preferences). If necessary, I’ll file a bug of course.

KERN: ps2_hid: init_hardware
KERN: ps2_hid: init_driver
KERN: ps2: active multiplexing v1.1 enabled
KERN: ps2_hid: publish_devices
KERN: ps2_hid: uninit_driver
KERN: loaded driver /boot/system/add-ons/kernel/drivers/dev/input/ps2_hid
KERN: ps2: reset failed
KERN: ps2: devfs_publish_device input/mouse/ps2/0, status = 0xffffffff
KERN: ps2: reset failed
KERN: ps2: devfs_publish_device input/mouse/ps2/1, status = 0xffffffff
KERN: ps2: reset failed
KERN: ps2: devfs_publish_device input/mouse/ps2/2, status = 0xffffffff
KERN: /dev/net/atheroswifi/0: media change, media 0x300a0 quality 1000 speed 0
KERN: ps2: devfs_publish_device input/touchpad/ps2/synaptics_3, status = 0x00000000
KERN: ps2: devfs_publish_device input/keyboard/at/0, status = 0x00000000
KERN: Highpoint-IDE: supports_device()
Last message repeated 1 time
KERN: loaded driver /boot/system/add-ons/kernel/drivers/dev/bus/usb_raw
KERN: sis7018:init_hardware:ver:2.0.2
KERN: pci_reserve_device(0, 27, 0, hda)
KERN: HDA: Detected controller @ PCI:0:27:0, IRQ:16, type 8086/1e20 (1ae0/c000)
KERN: loaded driver /boot/system/add-ons/kernel/drivers/dev/audio/hmulti/hda
KERN: emuxki: init_hardware()
KERN: echo3g: init_hardware()
KERN: echo3g: no card found
KERN: auvia: init_hardware()
KERN: auich: init_hardware()
KERN: ps2: keyboard found

Is that not a lot harder than just plugging in a mouse?

The heart wants what the heart wants. I have spent days writing software for problems that could be solved a different way just because I wanted something handled particular way.

On my System76 the touchpad thinks you clicked if you hover your hand too close to the pad for too long, yet I find I still rather use the pad over a mouse.

1 Like

The point is not so much getting mouse access as shutting down the touchpad. I forget whether I posted here somewhere (probably not) about my own desire for that feature, but I submitted a ticket on the topic ( #16281).

My problem is that accidentally touching the pad can cause an app – particularly a Terminal one – to go crazy. And it drives me crazy!

In the meantime, I have implemented a ‘hardware solution’… A piece of card folded over in such a way as to keep my hands off the pad! :grinning:

My Haiku Thinkpad is out of action at the moment and I can’t remember whether there is a way to disable the touchpad (as you can in Windows or Linux) or whether I don’t find it much of a problem.
I must say I am impressed by somebody writing his own program to do this, despite my slightly surprised comment.
And unlike the earl, I hate touchpads, and much prefer a mouse.

Knowing which device generated a click seems reasonable to me. @PulkoMandy or @PreetpalKaur might know better whether that is currently supported and how hard it might be to add (probably not very hard.) Preetpal is working on the new Input preferences in GSoC and PulkoMandy is her mentor.

Though in this case, obviously, it would be better to properly detect the touchpad and have a way to disable the device. Though I would really be curious to know how the touchpoint, touchpad and the keys in between are listed in the hardware on those ThinkPads.

I am not mentoring this project. The mentors are Scott and Rajagopalan. Please don’t add more work to me :slight_smile:

I see you are running an older version (beta2?) of Haiku. In the nightly builds we have fixed a bug so the touchpad preferences should be back in Input preferences. This would allow disabling tap to click, at least. We have also integrated PadBlocker which disable all pointing devices when the keyboard is being used.

The current input_server design does not make it easy to disable a single device. It’s possible to add this. Preetpal is indeed currently working on adding a way to have different settings for each device, and adding a “disabled” setting there should not be too hard once we have everything in place in input_server.

I didn’t want to disable the entire touchpad, but only clicks and taps. I suppose, this particular feature will never be exposed in the GUI and I’m not asking for it. I was just hoping, there was a way to hack around this, as I did on Linux with some piece of Xorg config. A few lines of C++ don’t scare me away - I’ve read the PadBlocker sources.
But it’s not really crucial - this is only a notebook for testing Haiku. If I really cared, I’d order a replacement bezel for the touchpad…
I will wait for the next official Haiku release before upgrading and immediately open a ticket should problems with detecting the devices persist.