svn commit: r314467 - head/sys/dev/usb/input
Warner Losh
imp at FreeBSD.org
Wed Mar 1 04:27:59 UTC 2017
Author: imp
Date: Wed Mar 1 04:27:58 2017
New Revision: 314467
URL: https://svnweb.freebsd.org/changeset/base/314467
Log:
Make wsp process a single touchpad tap and interpret it as a
left-click event. It can be disabled setting the new
hw.usb.wsp.enable_single_tap_clicks sysctl to 0.
Submitted by: K Staring <qdk at quickdekay.net>
Pull Request: https://github.com/freebsd/freebsd/pull/97
Modified:
head/sys/dev/usb/input/wsp.c
Modified: head/sys/dev/usb/input/wsp.c
==============================================================================
--- head/sys/dev/usb/input/wsp.c Wed Mar 1 04:24:56 2017 (r314466)
+++ head/sys/dev/usb/input/wsp.c Wed Mar 1 04:27:58 2017 (r314467)
@@ -87,6 +87,7 @@ static struct wsp_tuning {
int pressure_untouch_threshold;
int pressure_tap_threshold;
int scr_hor_threshold;
+ int enable_single_tap_clicks;
}
wsp_tuning =
{
@@ -96,6 +97,7 @@ static struct wsp_tuning {
.pressure_untouch_threshold = 10,
.pressure_tap_threshold = 120,
.scr_hor_threshold = 20,
+ .enable_single_tap_clicks = 1,
};
static void
@@ -107,6 +109,7 @@ wsp_runing_rangecheck(struct wsp_tuning
WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255);
WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255);
WSP_CLAMP(ptun->scr_hor_threshold, 1, 255);
+ WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1);
}
SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN,
@@ -121,6 +124,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressu
&wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold");
SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN,
&wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold");
+SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN,
+ &wsp_tuning.enable_single_tap_clicks, 0, "enable single tap clicks");
/*
* Some tables, structures, definitions and constant values for the
@@ -966,7 +971,7 @@ wsp_intr_callback(struct usb_xfer *xfer,
*/
switch (sc->ntaps) {
case 1:
- if (!(params->caps & HAS_INTEGRATED_BUTTON)) {
+ if (!(params->caps & HAS_INTEGRATED_BUTTON) || tun.enable_single_tap_clicks) {
wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON1DOWN);
DPRINTFN(WSP_LLEVEL_INFO, "LEFT CLICK!\n");
}
More information about the svn-src-head
mailing list