Opened 4 years ago

Last modified 4 weeks ago

#11673 assigned enhancement

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

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


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) (12.4 KB) - added by humdinger 4 years ago.
original TouchpadInputServerFilter

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by humdinger

original TouchpadInputServerFilter

comment:1 Changed 4 years ago by waddlesplash

Owner: changed from czeidler to waddlesplash
Status: newassigned

comment:2 Changed 3 years ago by humdinger

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 Changed 2 months ago by yatendra1999

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

comment:4 Changed 5 weeks ago by Oishika

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 Changed 4 weeks ago by Oishika

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 Changed 4 weeks ago by pulkomandy

In the comment at the start of the sourcecode I found this:

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 4 weeks ago by pulkomandy (previous) (diff)

comment:7 Changed 4 weeks ago by Oishika

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 Changed 4 weeks ago by cb88

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 Changed 4 weeks ago by pulkomandy

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

Note: See TracTickets for help on using tickets.