From owner-svn-src-all@FreeBSD.ORG Wed Mar 12 08:23:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FDF0477; Wed, 12 Mar 2014 08:23:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 125AAA31; Wed, 12 Mar 2014 08:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2C8NRGc067432; Wed, 12 Mar 2014 08:23:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8NRCo067431; Wed, 12 Mar 2014 08:23:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403120823.s2C8NRCo067431@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Mar 2014 08:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263072 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:23:28 -0000 Author: hselasky Date: Wed Mar 12 08:23:27 2014 New Revision: 263072 URL: http://svnweb.freebsd.org/changeset/base/263072 Log: MFC r262477: Updates for WSP driver. Modified: stable/10/sys/dev/usb/input/wsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/wsp.c ============================================================================== --- stable/10/sys/dev/usb/input/wsp.c Wed Mar 12 08:21:36 2014 (r263071) +++ stable/10/sys/dev/usb/input/wsp.c Wed Mar 12 08:23:27 2014 (r263072) @@ -94,8 +94,8 @@ static struct wsp_tuning { .z_factor = 5, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, - .pressure_tap_threshold = 120, - .scr_hor_threshold = 50, + .pressure_tap_threshold = 100, + .scr_hor_threshold = 10, }; static void @@ -791,9 +791,13 @@ wsp_intr_callback(struct usb_xfer *xfer, } break; case 2: - if (sc->distance < MAX_DISTANCE) + DPRINTFN(WSP_LLEVEL_INFO, "sum_x=%5d, sum_y=%5d\n", + sc->dx_sum, sc->dy_sum); + if (sc->distance < MAX_DISTANCE && abs(sc->dx_sum) < 5 && + abs(sc->dy_sum) < 5) { wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); - DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + } break; case 3: wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON2DOWN); @@ -804,8 +808,7 @@ wsp_intr_callback(struct usb_xfer *xfer, } wsp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ } - if (sc->intr_count >= WSP_TAP_MAX_COUNT && - (sc->dt_sum / tun.scr_hor_threshold) != 0 && + if ((sc->dt_sum / tun.scr_hor_threshold) != 0 && sc->ntaps == 2 && sc->scr_mode == WSP_SCR_HOR) { /* @@ -903,7 +906,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (ntouch == 2 && sc->sc_status.button == 0) { if (sc->scr_mode == WSP_SCR_NONE && - abs(sc->dx_sum) + abs(sc->dy_sum) > 50) + abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > abs(sc->dy_sum) ? WSP_SCR_HOR : WSP_SCR_VER; @@ -918,10 +921,16 @@ wsp_intr_callback(struct usb_xfer *xfer, dy = 0; if (sc->dz_count == 0) dz = sc->dz_sum / tun.z_factor; - if (abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || + if (sc->scr_mode == WSP_SCR_HOR || + abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) dz = 0; } + if (ntouch == 3) { + dx = 0; + dy = 0; + dz = 0; + } if (sc->intr_count < WSP_TAP_MAX_COUNT && abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) { dx = dy = dz = 0;