Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2014 18:42:41 GMT
From:      Brock Williams <brock@cottonwoodcomputer.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/186045: patch to xf86-input-mouse to support FlipXY
Message-ID:  <201401231842.s0NIgfBX039807@oldred.freebsd.org>
Resent-Message-ID: <201401231850.s0NIo0TN090292@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186045
>Category:       ports
>Synopsis:       patch to xf86-input-mouse to support FlipXY
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 23 18:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Brock Williams
>Release:        9.2-RELEASE
>Organization:
Cottonwood Computer
>Environment:
FreeBSD touchscreentest 9.2-RELEASE FreeBSD 9.2-RELEASE #0: Mon Oct 21 16:18:54 MDT 2013     ccs@touchscreentest:/usr/obj/usr/src/sys/NO_HID  i386
>Description:
Additional patch for x11-drivers/xf86-input-mouse to support FlipXY/SwapXY option.  This allows us to use an eGalax based usb hid touchscreen where the axes are inverted.  See kern/183032 for more discussion.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- src/bsd_mouse.c	2014-01-23 11:30:52.000000000 -0700
+++ /home/ccs/bsd_mouse.c	2014-01-23 11:30:40.000000000 -0700
@@ -916,7 +916,7 @@
     hid_item_t h;
     struct UsbMseAcol *acol;
     struct UsbMseLcol *lcol;
-    int mdepth, rsize, *rsizep, acolused, lcolused, used;
+    int mdepth, rsize, *rsizep, acolused, lcolused, used, swapxy;
 
     pUsbMse = malloc(sizeof(UsbMseRec));
     if (pUsbMse == NULL) {
@@ -939,6 +939,10 @@
             return FALSE;
         }
     }
+
+    swapxy=xf86SetBoolOption(pInfo->options, "SwapXY", 0);
+    swapxy|=xf86SetBoolOption(pInfo->options, "FlipXY", 0);
+
     /* Get USB informations */
     reportDesc = hid_get_report_desc(pInfo->fd);
     mdepth = 0;
@@ -991,7 +995,7 @@
 	    if (mdepth == 0)
 		break;
 	    used = 1;
-	    if (h.usage == 0x00010030) { /* X */
+	    if ( (swapxy==0 && h.usage == 0x00010030) || (swapxy==1 && h.usage==0x00010031)) { /* X */
 		lcol->loc_x = h;
 		if ((h.flags & 0x04) == 0) {
 		    if (acol->xmin == acol->xmax) {
@@ -1002,7 +1006,7 @@
 			acol->xmax = max(acol->xmax, h.logical_maximum);
 		    }
 		}
-	    } else if (h.usage == 0x00010031) { /* Y */
+	    } else if ( (swapxy==0 && h.usage == 0x00010031) || (swapxy==1 && h.usage==0x00010030)) { /* Y */
 		lcol->loc_y = h;
 		if ((h.flags & 0x04) == 0) {
 		    if (acol->ymin == acol->ymax) {


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401231842.s0NIgfBX039807>