From owner-svn-src-all@FreeBSD.ORG Tue Feb 25 08:37:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65624F9F; Tue, 25 Feb 2014 08:37:07 +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 455FE1BF7; Tue, 25 Feb 2014 08:37:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P8b7ZI000560; Tue, 25 Feb 2014 08:37:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P8b7lr000559; Tue, 25 Feb 2014 08:37:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402250837.s1P8b7lr000559@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 25 Feb 2014 08:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262477 - 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-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: Tue, 25 Feb 2014 08:37:07 -0000 Author: hselasky Date: Tue Feb 25 08:37:06 2014 New Revision: 262477 URL: http://svnweb.freebsd.org/changeset/base/262477 Log: Updates for WSP driver: 1) Add support for page back/forward. 2) While doing HOR scrolling, disable VER scrolling. 3) Checking dx_sum and dy_sum before emulate right button, this can avoids unexpected right button press. 4) Fix stable pointer operation when emulating middle button. Submitted by: Huang Wen Hui MFC after: 2 weeks Modified: head/sys/dev/usb/input/wsp.c Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Tue Feb 25 07:59:33 2014 (r262476) +++ head/sys/dev/usb/input/wsp.c Tue Feb 25 08:37:06 2014 (r262477) @@ -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;