Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsp: multi-finger touchpad improvements #1365

Merged
merged 26 commits into from
Sep 6, 2024
Merged

Conversation

MegaManSec
Copy link
Contributor

Currently, the wsp driver limits the ability for a single-click (left click) on the touchpad followed by a partial release (finger still on the trackpad). When you single-click then partially release, the trackpad is frozen and you cannot continue movement until you fully release the button and re-touch the trackpad for movement.

This patch provides the ability to continue movement after a single-click has taken place.

The tunable hw.usb.wsp.enable_single_tap_movement (1=enabled by default) has already been created for those that do not want to allow the movement of the trackpad after a single click.

Likewise, the wsp driver does not currently correctly allow the movement of the trackpad using two fingers while a single button is held down: that is to say, during a single-button click, it is only possible to move the cursor using the same finger that is clicking.

This patch provides support for the movement using a second finger, which is in-line with how MacOS supports this trackpad: a single button click can be moved using either the original finger or a secondary finger on the trackpad following the first click. It appears that this was originally missed by the developer, as the comments suggest that the variables holding the position arrays should be arrays, however they were not:
int16_t pre_pos_x; /* previous position array /
int16_t pre_pos_y; /
previous position array */
This patch makes them arrays of int16_t, in-line with the "finger index data" and "position array" arrays.

In addition, this patch also creates two tunables:
hw.usb.wsp.max_finger_area
hw.usb.wsp.max_double_tap_distance

max_finger_area is the maximum area that a finger may take up on the trackpad to be registered as a finger. Previously, it was hardcoded 1200. This value was too low to register a thumb-click, which MacOS does correctly.

max_double_tap_distance is the maximum distance between two fingers which permit a two-finger-click to be registered as a double-click. Previously, this was hardcoded as 2500, and that is left as the default.

@bsdimp
Copy link
Member

bsdimp commented Aug 23, 2024

@wulf7 Can you take a look? This seems up your alley, but if not just say so.

@wulf7
Copy link
Contributor

wulf7 commented Aug 25, 2024

@wulf7 Can you take a look? This seems up your alley, but if not just say so.

LGTM.

Note that this change does not affect default setup. One should switch evdev to stream events through sysmouse interface rather than directly from wsp(4) driver. Otherwise libinput is responsible for gesture processing.

@wulf7 wulf7 added ready and removed needs-review labels Aug 25, 2024
bsdimp pushed a commit to VexedUXR/freebsd-src that referenced this pull request Sep 6, 2024
This provides functionality for a click which is partially unreleased
and then allows the user to continue moving the mousepad as if were not
invoked as a full click

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
bsdimp pushed a commit to VexedUXR/freebsd-src that referenced this pull request Sep 6, 2024
This patch allows scrolling with multiple fingers simultaneously, in
line with how wsp trackpads function on MacOS.

Two new tunables are added: hw.usb.wsp.max_finger_area and
hw.usb.wsp.max_double_tap_distance.

max_finger_area defines the maximum size which the driver registered an
object on trackpad as a finger.
Previously, this value was hardcoded as 1200, which was too low to
register thumb-clicks.

max_double_tap_distance defines the maximum distance between two
fingers which will register as a double-click.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
bsdimp pushed a commit to VexedUXR/freebsd-src that referenced this pull request Sep 6, 2024
Also correctly use tun.max_double_tap_distance for maximum distance
of fingers for vertical scrolling.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
@bsdimp bsdimp self-requested a review as a code owner September 6, 2024 18:34
sebhub and others added 19 commits September 6, 2024 12:34
For example, printf("%+i", 1) prints "+1".  However, kvprintf() did
print just "1" for this example.  According to PRINTF(3):

  A sign must always be placed before a number produced by a signed
  conversion.

For "%+r" radix conversions, keep the "+" handling as it is, since this
is a non-standard conversion.  For "%+p" pointer conversions, continue
to ignore the sign modifier to be in line with libc.

This change allows to support the ' conversion modifier in the future.

Reviewed by: imp
Pull Request: freebsd#1310
10ms seems to be too strict for some configurations, so increase to
20ms.

Reviewed by: imp
Pull Request: freebsd#1327
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: freebsd#1350
Closes:		280538
Fixes:		cf8a18 (back out logging to /var/log/adduser)
MFC after:	3 days
Reported by:	Herbert Baerschneider <herbert.baerschneider@protonmail.com>

Reviewed by: imp
Pull Request: freebsd#1354
This provides functionality for a click which is partially unreleased
and then allows the user to continue moving the mousepad as if were not
invoked as a full click

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
This patch allows scrolling with multiple fingers simultaneously, in
line with how wsp trackpads function on MacOS.

Two new tunables are added: hw.usb.wsp.max_finger_area and
hw.usb.wsp.max_double_tap_distance.

max_finger_area defines the maximum size which the driver registered an
object on trackpad as a finger.
Previously, this value was hardcoded as 1200, which was too low to
register thumb-clicks.

max_double_tap_distance defines the maximum distance between two
fingers which will register as a double-click.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
Also correctly use tun.max_double_tap_distance for maximum distance
of fingers for vertical scrolling.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd#1365
The struct timespec tv_sec member is of type time_t.  Make sure that all
variables related to this member are of the type time_t.  This is important for
targets where long is a 32-bit type and time_t a 64-bit type.

Reviewed by: imp
Pull Request: freebsd#1373
Commit e695500 updated the policy table
to match RFC 6724, which obsoletes RFC 3484.

Add a reference to RFC 6724, and mark it up as a technical report (%R).

MFC after:	3 days
Signed-off-by:	Jose Luis Duran <jlduran@gmail.com>

Reviewed by: imp, glebius
Pull Request: freebsd#1375
Update the sample ip6addrctl.conf.sample file to match the default
policy, currently based on RFC 6724.

MFC after:	3 days
Signed-off-by:	Jose Luis Duran <jlduran@gmail.com>

Reviewed by: imp, glebius
Pull Request: freebsd#1375
Reviewed by: imp, glebius
Pull Request: freebsd#1375
The error was always returned, even after handling the sysctl, breaking
installworld under Linux.

Sponsored by:		https://www.patreon.com/valpackett

Reviewed by: imp
Pull Request: freebsd#1376
MFC after:	3 days

Reviewed by: imp
Pull Request: freebsd#1378
concussious and others added 7 commits September 6, 2024 12:34
MFC after:	3 days

Reviewed by: imp
Pull Request: freebsd#1379
Fixes:		86c06f (Remove GEOM_SCHED class and gsched)
MFC after:	3 days

Reviewed by: imp
Pull Request: freebsd#1380
MFC after:	3 days

Reviewed by: imp
Pull Request: freebsd#1382
+ consistent document description languague with other USB-BaseT drivers
+ mention newly added adapters from 6ea4d9
+ attempt to mention rgephy(4) phys feed into ure interfaces

Fixes:		6ea4d9 (Move RTL8156 from cdce(4) to ure(4))
MFC after:	3 days

Reviewed by: imp
Pull Request: freebsd#1384
Signed-off-by: Tom Hukins <tom@FreeBSD.org>
Reviewed by: imp
Pull Request: freebsd#1385
Add logic that checks if the code doesn't overflow
ACPI_EXTENDED_HID_DEVICE_PATH node when searching for optional
strings. If the string is not provided in the device path node
default value of "\0" is used.

Upstream PR:	https://bugzilla.tianocore.org/show_bug.cgi?id=4555
Obtained from:	tianocore/edk2@96ed60d

Reviewed by: imp
Pull Request: freebsd#1388
Since 26b9e1f codel was fixed but traffic was not flowing for
pie too. Apply the same fix.

MFC after:	1 week
Sponsored by:	OPNsense
Differential Revision:	https://reviews.freebsd.org/D46182
Also see:	https://redmine.pfsense.org/issues/13996
Also see:	https://forum.opnsense.org/index.php?topic=41827.0
Reviewed by: imp, markj
Pull Request: freebsd#1390
@freebsd-git freebsd-git merged commit 2b7f289 into freebsd:main Sep 6, 2024
102 of 121 checks passed
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 3, 2024
This provides functionality for a click which is partially unreleased
and then allows the user to continue moving the mousepad as if were not
invoked as a full click

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 3, 2024
This patch allows scrolling with multiple fingers simultaneously, in
line with how wsp trackpads function on MacOS.

Two new tunables are added: hw.usb.wsp.max_finger_area and
hw.usb.wsp.max_double_tap_distance.

max_finger_area defines the maximum size which the driver registered an
object on trackpad as a finger.
Previously, this value was hardcoded as 1200, which was too low to
register thumb-clicks.

max_double_tap_distance defines the maximum distance between two
fingers which will register as a double-click.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 3, 2024
Also correctly use tun.max_double_tap_distance for maximum distance
of fingers for vertical scrolling.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
This provides functionality for a click which is partially unreleased
and then allows the user to continue moving the mousepad as if were not
invoked as a full click

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
This patch allows scrolling with multiple fingers simultaneously, in
line with how wsp trackpads function on MacOS.

Two new tunables are added: hw.usb.wsp.max_finger_area and
hw.usb.wsp.max_double_tap_distance.

max_finger_area defines the maximum size which the driver registered an
object on trackpad as a finger.
Previously, this value was hardcoded as 1200, which was too low to
register thumb-clicks.

max_double_tap_distance defines the maximum distance between two
fingers which will register as a double-click.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
Also correctly use tun.max_double_tap_distance for maximum distance
of fingers for vertical scrolling.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
This provides functionality for a click which is partially unreleased
and then allows the user to continue moving the mousepad as if were not
invoked as a full click

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
This patch allows scrolling with multiple fingers simultaneously, in
line with how wsp trackpads function on MacOS.

Two new tunables are added: hw.usb.wsp.max_finger_area and
hw.usb.wsp.max_double_tap_distance.

max_finger_area defines the maximum size which the driver registered an
object on trackpad as a finger.
Previously, this value was hardcoded as 1200, which was too low to
register thumb-clicks.

max_double_tap_distance defines the maximum distance between two
fingers which will register as a double-click.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Dec 4, 2024
Also correctly use tun.max_double_tap_distance for maximum distance
of fingers for vertical scrolling.

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by: imp, wulf
Pull Request: freebsd/freebsd-src#1365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.