From owner-svn-src-head@freebsd.org Wed Mar 1 04:27:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E1ACF2042; Wed, 1 Mar 2017 04:27:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F54F2; Wed, 1 Mar 2017 04:27:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v214Rwc2019208; Wed, 1 Mar 2017 04:27:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v214RwnH019207; Wed, 1 Mar 2017 04:27:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703010427.v214RwnH019207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 1 Mar 2017 04:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314467 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 04:27:59 -0000 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 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"); }