diff options
author | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1998-03-06 03:09:31 +0000 |
---|---|---|
committer | Kazutaka YOKOTA <yokota@FreeBSD.org> | 1998-03-06 03:09:31 +0000 |
commit | 36b1e17db4a171b3a3717ee5ca50ce206cea64a9 (patch) | |
tree | cd2f23290557ae291621746a7fd7aa93071b925c | |
parent | 0d41e7b8200eba04a01a54b54aaf0d680d875cc0 (diff) | |
download | src-36b1e17db4a171b3a3717ee5ca50ce206cea64a9.tar.gz src-36b1e17db4a171b3a3717ee5ca50ce206cea64a9.zip |
Add 4th button support for the "MouseMan" protocol. The latest
trackball model from Logitech has four buttons.
Notes
Notes:
svn path=/head/; revision=34074
-rw-r--r-- | usr.sbin/moused/moused.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index ff7462625323..2acf4873541f 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: moused.c,v 1.14 1998/01/20 03:38:36 yokota Exp $"; + "$Id: moused.c,v 1.15 1998/02/04 06:46:33 ache Exp $"; #endif /* not lint */ #include <err.h> @@ -805,7 +805,7 @@ static unsigned char proto[][7] = { { 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* MouseSystems */ { 0xe0, 0x80, 0x80, 0x00, 3, 0x00, 0xff }, /* Logitech */ { 0xe0, 0x80, 0x80, 0x00, 3, 0x00, 0xff }, /* MMSeries */ - { 0x40, 0x40, 0x40, 0x00, 3, ~0x23, 0x00 }, /* MouseMan */ + { 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* MouseMan */ { 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* Bus */ { 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* InPort */ { 0xc0, 0x00, 0x00, 0x00, 3, 0x00, 0xff }, /* PS/2 mouse */ @@ -1338,12 +1338,13 @@ r_protocol(u_char rBuf, mousestatus_t *act) { case MOUSE_PROTO_MS: /* Microsoft */ case MOUSE_PROTO_LOGIMOUSEMAN: /* MouseMan/TrackMan */ + act->button = act->obutton & MOUSE_BUTTON4DOWN; if (rodent.flags & ChordMiddle) - act->button = ((pBuf[0] & MOUSE_MSS_BUTTONS) == MOUSE_MSS_BUTTONS) + act->button |= ((pBuf[0] & MOUSE_MSS_BUTTONS) == MOUSE_MSS_BUTTONS) ? MOUSE_BUTTON2DOWN : butmapmss[(pBuf[0] & MOUSE_MSS_BUTTONS) >> 4]; else - act->button = (act->obutton & MOUSE_BUTTON2DOWN) + act->button |= (act->obutton & MOUSE_BUTTON2DOWN) | butmapmss[(pBuf[0] & MOUSE_MSS_BUTTONS) >> 4]; act->dx = (char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); act->dy = (char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); |