From aakuusta@gmail.com  Fri Sep  2 08:44:27 2011
Return-Path: <aakuusta@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8493D106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2011 08:44:27 +0000 (UTC)
	(envelope-from aakuusta@gmail.com)
Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com [209.85.210.45])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F9738FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2011 08:44:27 +0000 (UTC)
Received: by pzk33 with SMTP id 33so8092316pzk.18
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 02 Sep 2011 01:44:27 -0700 (PDT)
Received: by 10.68.71.167 with SMTP id w7mr1594665pbu.386.1314951661421;
        Fri, 02 Sep 2011 01:21:01 -0700 (PDT)
Received: from localhost (tor-exit-router35-readme.formlessnetworking.net. [199.48.147.35])
        by mx.google.com with ESMTPS id t7sm8587787pbn.11.2011.09.02.01.20.58
        (version=SSLv3 cipher=OTHER);
        Fri, 02 Sep 2011 01:21:00 -0700 (PDT)
Message-Id: <86liu7jqxm.fsf@gmail.com>
Date: Fri, 02 Sep 2011 12:20:53 +0400
From: h h <aakuusta@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] invert Z axis movement via moused(8)

>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:
