From owner-freebsd-stable Sun Apr 16 22:45: 8 2000 Delivered-To: freebsd-stable@freebsd.org Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (Postfix) with ESMTP id 6409A37B969 for ; Sun, 16 Apr 2000 22:45:03 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:vr6uBk55i7LGEqknZ74Ob8eQSPyVR9pD@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.9.3/3.7Wpl2) with ESMTP id OAA04643; Mon, 17 Apr 2000 14:44:21 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id OAA26290; Mon, 17 Apr 2000 14:50:54 +0900 (JST) Message-Id: <200004170550.OAA26290@zodiac.mech.utsunomiya-u.ac.jp> To: "Sean O'Connell" , "Robert Watson" Cc: FreeBSD stable , yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: middle mouse button emulation broken In-reply-to: Your message of "Fri, 14 Apr 2000 16:48:59 -0400." <20000414164859.G18075@stat.Duke.EDU> References: <20000414164859.G18075@stat.Duke.EDU> Date: Mon, 17 Apr 2000 14:50:53 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >I'd like to report a "Me too" on Robert Watson's report of >middle mouse emulation breakage under X. I just updated a >laptop (touchpad with 2 button mouse) running 4.0-RELEASE >to 4.0-STABLE using sources cvsup'd this morning. [...] # Sorry for not replying earlier. I have been out of town for a week. There was a couple of fixes in the -CURRENT branch. They have not been MFCed to -STABLE yet. Please apply the following patch to /usr/src/usr.sbin/moused/moused.c. Also, try reducing the timeout value for the 3 button emulation. The default value is 200 msec after the patch (it was 500 msec before the patch). The value determines the duration during which you have to keep pressing the button before moused reports that the button is being pressed. You may feel comfortable with the timeout value of 100 msec or less. Kazu Index: moused.c =================================================================== RCS file: /src/CVS/src/usr.sbin/moused/moused.c,v retrieving revision 1.42 retrieving revision 1.44 diff -u -r1.42 -r1.44 --- moused.c 2000/03/31 12:35:33 1.42 +++ moused.c 2000/04/11 11:09:39 1.44 @@ -76,7 +76,7 @@ #define MAX_CLICKTHRESHOLD 2000 /* 2 seconds */ #define MAX_BUTTON2TIMEOUT 2000 /* 2 seconds */ #define DFLT_CLICKTHRESHOLD 500 /* 0.5 second */ -#define DFLT_BUTTON2TIMEOUT 500 /* 0.5 second */ +#define DFLT_BUTTON2TIMEOUT 200 /* 0.2 second */ #define TRUE 1 #define FALSE 0 @@ -431,27 +431,28 @@ int s[A_TIMEOUT + 1]; int buttons; int mask; + int timeout; } states[10] = { /* S0 */ - { { S0, S2, S1, S3, S0 }, 0, ~(MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN) }, + { { S0, S2, S1, S3, S0 }, 0, ~(MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN), FALSE }, /* S1 */ - { { S4, S2, S1, S3, S5 }, 0, ~MOUSE_BUTTON1DOWN }, + { { S4, S2, S1, S3, S5 }, 0, ~MOUSE_BUTTON1DOWN, FALSE }, /* S2 */ - { { S8, S2, S1, S3, S6 }, 0, ~MOUSE_BUTTON3DOWN }, + { { S8, S2, S1, S3, S6 }, 0, ~MOUSE_BUTTON3DOWN, FALSE }, /* S3 */ - { { S0, S9, S9, S3, S3 }, MOUSE_BUTTON2DOWN, ~0 }, + { { S0, S9, S9, S3, S3 }, MOUSE_BUTTON2DOWN, ~0, FALSE }, /* S4 */ - { { S0, S2, S1, S3, S0 }, MOUSE_BUTTON1DOWN, ~0 }, + { { S0, S2, S1, S3, S0 }, MOUSE_BUTTON1DOWN, ~0, TRUE }, /* S5 */ - { { S0, S2, S5, S7, S5 }, MOUSE_BUTTON1DOWN, ~0 }, + { { S0, S2, S5, S7, S5 }, MOUSE_BUTTON1DOWN, ~0, FALSE }, /* S6 */ - { { S0, S6, S1, S7, S6 }, MOUSE_BUTTON3DOWN, ~0 }, + { { S0, S6, S1, S7, S6 }, MOUSE_BUTTON3DOWN, ~0, FALSE }, /* S7 */ - { { S0, S6, S5, S7, S7 }, MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN, ~0 }, + { { S0, S6, S5, S7, S7 }, MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN, ~0, FALSE }, /* S8 */ - { { S0, S2, S1, S3, S0 }, MOUSE_BUTTON3DOWN, ~0 }, + { { S0, S2, S1, S3, S0 }, MOUSE_BUTTON3DOWN, ~0, TRUE }, /* S9 */ - { { S0, S9, S9, S3, S9 }, 0, ~(MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN) }, + { { S0, S9, S9, S3, S9 }, 0, ~(MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN), FALSE }, }; static int mouse_button_state; static struct timeval mouse_button_state_tv; @@ -618,8 +619,6 @@ } rodent.zmap[0] = i; rodent.zmap[1] = i + 1; - mstate[i - 1] = &zstate[0]; - mstate[i] = &zstate[1]; debug("optind: %d, optarg: '%s'", optind, optarg); for (j = 1; j < 4; ++j) { if ((optind >= argc) || !isdigit(*argv[optind])) @@ -630,17 +629,10 @@ usage(); } rodent.zmap[j] = i; - mstate[i - 1] = &zstate[j]; ++optind; } - if ((rodent.zmap[2] != 0) && (rodent.zmap[3] == 0)) { + if ((rodent.zmap[2] != 0) && (rodent.zmap[3] == 0)) rodent.zmap[3] = rodent.zmap[2] + 1; - mstate[rodent.zmap[3] - 1] = &zstate[3]; - } - for (i = 0; i < 4; ++i) { - if (rodent.zmap[i] != 0) - rodent.zmap[i] = 1 << (rodent.zmap[i] - 1); - } } break; @@ -711,6 +703,17 @@ usage(); } + /* fix Z axis mapping */ + for (i = 0; i < 4; ++i) { + if (rodent.zmap[i] > 0) { + for (j = 0; j < MOUSE_MAXBUTTON; ++j) { + if (mstate[j] == &bstate[rodent.zmap[i] - 1]) + mstate[j] = &zstate[i]; + } + rodent.zmap[i] = 1 << (rodent.zmap[i] - 1); + } + } + /* the default port name */ switch(rodent.rtype) { @@ -2167,6 +2170,8 @@ struct timeval tv1; struct timeval tv2; + if (states[mouse_button_state].timeout) + return TRUE; gettimeofday(&tv1, NULL); tv2.tv_sec = rodent.button2timeout/1000; tv2.tv_usec = (rodent.button2timeout%1000)*1000; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message