From owner-svn-src-head@FreeBSD.ORG Wed May 12 22:43:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC37E1065670; Wed, 12 May 2010 22:43:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABB688FC15; Wed, 12 May 2010 22:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMhXSI045334; Wed, 12 May 2010 22:43:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMhXaj045331; Wed, 12 May 2010 22:43:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201005122243.o4CMhXaj045331@svn.freebsd.org> From: Andrew Thompson Date: Wed, 12 May 2010 22:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208009 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 12 May 2010 22:43:33 -0000 Author: thompsa Date: Wed May 12 22:43:33 2010 New Revision: 208009 URL: http://svn.freebsd.org/changeset/base/208009 Log: Enable support for mouse panning wheels. Submitted by: Henry Hu Modified: head/sys/dev/usb/input/ums.c head/sys/dev/usb/usbhid.h Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Wed May 12 22:42:35 2010 (r208008) +++ head/sys/dev/usb/input/ums.c Wed May 12 22:43:33 2010 (r208009) @@ -286,6 +286,12 @@ ums_intr_callback(struct usb_xfer *xfer, DPRINTFN(6, "x:%d y:%d z:%d t:%d w:%d buttons:0x%08x\n", dx, dy, dz, dt, dw, buttons); + /* translate T-axis into button presses until further */ + if (dt > 0) + buttons |= 1UL << 3; + else if (dt < 0) + buttons |= 1UL << 4; + sc->sc_status.button = buttons; sc->sc_status.dx += dx; sc->sc_status.dy += dy; @@ -454,6 +460,12 @@ ums_hid_parse(struct ums_softc *sc, devi if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { info->sc_flags |= UMS_FLAG_T_AXIS; } + } else if (hid_locate(buf, len, HID_USAGE2(HUP_CONSUMER, + HUC_AC_PAN), hid_input, index, &info->sc_loc_t, + &flags, &info->sc_iid_t)) { + + if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) + info->sc_flags |= UMS_FLAG_T_AXIS; } /* figure out the number of buttons */ Modified: head/sys/dev/usb/usbhid.h ============================================================================== --- head/sys/dev/usb/usbhid.h Wed May 12 22:42:35 2010 (r208008) +++ head/sys/dev/usb/usbhid.h Wed May 12 22:43:33 2010 (r208009) @@ -156,6 +156,9 @@ struct usb_hid_descriptor { #define HUD_ERASER 0x0045 #define HUD_TABLET_PICK 0x0046 +/* Usages, Consumer */ +#define HUC_AC_PAN 0x0238 + #define HID_USAGE2(p,u) (((p) << 16) | (u)) #define UHID_INPUT_REPORT 0x01