Opened 9 years ago

Closed 4 years ago

#11673 closed enhancement (fixed)

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

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone: R1/beta3
Component: Preferences/Input Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #16281
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 9 years ago.
original TouchpadInputServerFilter

Download all attachments as: .zip

Change History (15)

by humdinger, 9 years ago

original TouchpadInputServerFilter

comment:1 by waddlesplash, 9 years ago

Owner: changed from czeidler to waddlesplash
Status: newassigned

comment:2 by humdinger, 8 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, 5 years ago

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

comment:4 by Oishika, 5 years 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, 5 years 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, 5 years 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.

Version 0, edited 5 years ago by pulkomandy (next)

comment:7 by Oishika, 5 years 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, 5 years 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, 5 years ago

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

comment:10 by waddlesplash, 5 years ago

Owner: changed from waddlesplash to nobody

comment:11 by pulkomandy, 5 years ago

Owner: changed from nobody to pulkomandy

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

comment:12 by pulkomandy, 4 years ago

Component: Preferences/TouchpadPreferences/Input

comment:13 by diver, 4 years ago

Blocking: 16281 added

comment:14 by pulkomandy, 4 years ago

Milestone: R1R1/beta3
Resolution: fixed
Status: assignedclosed

Patch has been merged.

Note: See TracTickets for help on using tickets.