Skip to content

Commit

Permalink
wsp: Use already-calculated distance of fingers for comparison.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MegaManSec authored and bsdimp committed Sep 6, 2024
1 parent f6f0485 commit 7c9cc1b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sys/dev/usb/input/wsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,9 +1263,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error)
dx = dy = 0;
if (sc->dz_count == 0)
dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1);
if (sc->scr_mode == WSP_SCR_HOR ||
abs(sc->pos_x[0] - sc->pos_x[1]) > tun.max_finger_area ||
abs(sc->pos_y[0] - sc->pos_y[1]) > tun.max_finger_area)
if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_double_tap_distance)
dz = 0;
}
if (ntouch == 3)
Expand Down

0 comments on commit 7c9cc1b

Please sign in to comment.