Opened 5 years ago

Last modified 3 months ago

#11673 assigned enhancement

Add mouse-down-filter-while-typing to Touchpad prefs (easy)

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Preferences/Touchpad Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This is hrev48584.

For BeOS, there's been an input_server filter that prevented you from accidentally creating mouse clicks on the touchpad while typing. I contacted the author, Shamyl Zakariya, who agreed to release the (tiny piece of) code for us. The archive is attached to this ticket.

I propose to integrate this setting in the Touchpad preferences. I'm not sure the setting has to be adjustable even, at least here the 300ms worked well enough. So, a checkbox should suffice, but if people complain, a slider would be OK too...

Attachments (1)

TouchpadInputServerFilter.zip (12.4 KB ) - added by humdinger 5 years ago.
original TouchpadInputServerFilter

Download all attachments as: .zip

Change History (12)

by humdinger, 5 years ago

original TouchpadInputServerFilter

comment:1 by waddlesplash, 5 years ago

Owner: changed from czeidler to waddlesplash
Status: newassigned

comment:2 by humdinger, 4 years ago

Now hosted at HaikuArchive as PadBlocker. Also available as package in HaikuDepot. Still, would be nice to see integrated into the system with a slider in the Touchpad prefs.

comment:3 by yatendra1999, 8 months ago

I wish to work on this ticket if that is okay :).

comment:4 by Oishika, 7 months ago

I was thinking of changing the value of _threshold as the slider is moved using a get function to get the current value and a set function to set the _threshold value to appropriate value. Am I going in the right direction?

comment:5 by Oishika, 7 months ago

I am unable to understand where to instantiate the PadBlocker object to be able to change the value of the _threshold variable with the value taken as input from the slider. Any help would be appreciated.

comment:6 by pulkomandy, 7 months ago

In the comment at the start of the sourcecode I found this: https://github.com/HaikuArchives/PadBlocker/blob/master/PadBlocker.cpp

Note: makes a settings file in home/config/settings/PadBlocker_settings . Just a text file, containing the sensitivity threshold in thousandths of a second. This number represents the delay between the last B_KEY_UP message and when the filter will allow a B_MOUSE_DOWN message. Eg, if less than _threshold has transpired between a B_KEY_DOWN and a B_MOUSE_DOWN, the mouse down event will be skipped, cast into oblivion.

So you just need to create that file and store the slider value in it. To write a file, you can use BFile (which is a BDataIO), or if you already know them, usual C (fprinf) or C++ (iostream) file operations.

In fact, you can find the code to create the file inside PadBlocker itself a few lines below.

Last edited 7 months ago by pulkomandy (previous) (diff)

comment:7 by Oishika, 7 months ago

Just changing the file will work? don't we have to instantiate the PadBlocker object somewhere? Or is it already built-in? Sorry for not getting things at one go, I'm still trying to navigate my way through the Haiku codebase.

comment:8 by cb88, 7 months ago

Padblocker is a input server filter you can install from as a package from HaikuDepot and not installed by default.

So maybe you only want to show settings for it if it is installed? Otherwise they won't do anything. Or perhaps it could just become part of the base install.

comment:9 by pulkomandy, 7 months ago

Yes, it should be integrated in the base install eventually.

comment:10 by waddlesplash, 3 months ago

Owner: changed from waddlesplash to nobody

comment:11 by pulkomandy, 3 months ago

Owner: changed from nobody to pulkomandy

Help reviewing and polishing https://review.haiku-os.org/c/haiku/+/1590 welcome :)

Note: See TracTickets for help on using tickets.