Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Sep 2011 12:20:53 +0400
From:      h h <aakuusta@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/160386: [patch] invert Z axis movement via moused(8)
Message-ID:  <86liu7jqxm.fsf@gmail.com>
Resent-Message-ID: <201109020850.p828o4cp038474@freefall.freebsd.org>

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

>Number:         160386
>Category:       bin
>Synopsis:       [patch] invert Z axis movement via moused(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 02 08:50:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     h h
>Release:        FreeBSD 9.0-BETA2 amd64
>Organization:
>Environment:
moused_flags="-a -1 -z -z" # invert X,Y,Z axes
>Description:
Provide a more predictable way to invert Z axis.

cf. http://forums.freebsd.org/showthread.php?t=2377
>How-To-Repeat:
>Fix:
--- a.diff begins here ---
Index: usr.sbin/moused/moused.8
===================================================================
--- usr.sbin/moused/moused.8	(revision 225315)
+++ usr.sbin/moused/moused.8	(working copy)
@@ -491,6 +491,8 @@ maybe:
 .It Ar x
 .It Ar y
 X or Y axis movement will be reported when the Z axis movement is detected.
+.It Ar -z
+Invert Z axis movement.
 .It Ar N
 Report down events for the virtual buttons
 .Ar N
Index: usr.sbin/moused/moused.c
===================================================================
--- usr.sbin/moused/moused.c	(revision 225315)
+++ usr.sbin/moused/moused.c	(working copy)
@@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$");
 
 #define MOUSE_XAXIS	(-1)
 #define MOUSE_YAXIS	(-2)
+#define MOUSE_IZAXIS	(-3)
 
 /* Logitech PS2++ protocol */
 #define MOUSE_PS2PLUS_CHECKBITS(b)	\
@@ -705,6 +706,8 @@ main(int argc, char *argv[])
 		rodent.zmap[0] = MOUSE_XAXIS;
 	    else if (strcmp(optarg, "y") == 0)
 		rodent.zmap[0] = MOUSE_YAXIS;
+	    else if (strcmp(optarg, "-z") == 0)
+		rodent.zmap[0] = MOUSE_IZAXIS;
 	    else {
 		i = atoi(optarg);
 		/*
@@ -2522,6 +2525,10 @@ r_map(mousestatus_t *act1, mousestatus_t *act2)
 	    act2->dz = 0;
 	}
 	break;
+    case MOUSE_IZAXIS:
+	if (act1->dz != 0)
+	    act2->dz = -act1->dz;
+	break;
     default:	/* buttons */
 	pbuttons &= ~(rodent.zmap[0] | rodent.zmap[1]
 		    | rodent.zmap[2] | rodent.zmap[3]);
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



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