Date: Tue, 18 Mar 1997 16:02:27 -0500 (EST) From: Louis Mamakos <louie@TransSys.COM> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/3028: add support for Glidepoint pointing device to moused Message-ID: <199703182102.QAA07943@whizzo.transsys.com> Resent-Message-ID: <199703182110.NAA28623@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 3028
>Category: bin
>Synopsis: add support for Glidepoint pointing device to moused
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Mar 18 13:10:01 PST 1997
>Last-Modified:
>Originator: Louis Mamakos
>Organization:
>Release: FreeBSD 3.0-CURRENT i386
>Environment:
X11R6, moused-based pointing device, glidepoint pointing device
>Description:
add support for glidepoint pointing device. specifically, support
"click" and "drag" gestures which the pointing device reports seperately,
and map into a left mouse button click/drag.
generalize usage message to accomodate future mouse types scalably.
>How-To-Repeat:
Really!
>Fix:
--- /usr/src/usr.sbin/moused/moused.c Sat Feb 22 11:06:42 1997
+++ /usr/users/louie/src/moused/moused.c Sat Mar 15 21:15:34 1997
@@ -75,6 +75,7 @@
#define R_LOGIMAN 6
#define R_PS_2 7
#define R_MMHITAB 8
+#define R_GLIDEPOINT 9
char *rnames[] = {
"xxx",
@@ -86,6 +87,7 @@
"mouseman",
"ps/2",
"mmhitab",
+ "glidepoint",
NULL
};
@@ -100,6 +102,7 @@
(CS7 | CREAD | CLOCAL | HUPCL ), /* MouseMan */
0, /* PS/2 */
(CS8 | CREAD | CLOCAL | HUPCL ), /* MMHitTablet */
+ 0, /* Glidepoint */
};
@@ -219,6 +222,7 @@
rodent.portname = "/dev/mse0";
break;
case R_PS_2:
+ case R_GLIDEPOINT:
if (!rodent.portname)
rodent.portname = "/dev/psm0";
break;
@@ -280,6 +284,8 @@
void
usage(void)
{
+ int i;
+
fprintf(stderr,
" Usage is %s [options] -p <port> -t <mousetype>\n"
" Options are -s Select 9600 baud mouse.\n"
@@ -290,15 +296,10 @@
" -D Lower DTR\n"
" -S baud Select explicit baud (1200..9600).\n"
" <mousetype> should be one of :\n"
- " microsoft\n"
- " mousesystems\n"
- " mmseries\n"
- " logitech\n"
- " busmouse\n"
- " mouseman\n"
- " ps/2\n"
- " mmhittab\n"
,progname);
+
+ for (i = 1; rnames[i]; i++)
+ fprintf(stderr, " %s\n", rnames[i]);
exit(1);
}
@@ -399,7 +400,8 @@
write(rodent.mfd, "*X", 2);
setmousespeed(1200, rodent.baudrate, rodentcflags[R_LOGIMAN]);
} else {
- if ((rodent.rtype != R_BUSMOUSE) && (rodent.rtype != R_PS_2))
+ if ((rodent.rtype != R_BUSMOUSE) && (rodent.rtype != R_PS_2)
+ && (rodent.rtype != R_GLIDEPOINT))
{
/* try all likely settings */
setmousespeed(9600, rodent.baudrate, rodentcflags[rodent.rtype]);
@@ -489,6 +491,7 @@
{ 0x40, 0x40, 0x40, 0x00, 3 }, /* MouseMan */
{ 0xc0, 0x00, 0x00, 0x00, 3 }, /* PS/2 mouse */
{ 0xe0, 0x80, 0x80, 0x00, 3 }, /* MM_HitTablet */
+ { 0xc0, 0x00, 0x00, 0x00, 3 }, /* glidepoint */
};
debug("received char 0x%x",(int)rBuf);
@@ -610,6 +613,16 @@
act.buttons = (pBuf[0] & 0x04) >> 1 | /* Middle */
(pBuf[0] & 0x02) >> 1 | /* Right */
(pBuf[0] & 0x01) << 2; /* Left */
+ act.dx = (pBuf[0] & 0x10) ? pBuf[1]-256 : pBuf[1];
+ act.dy = (pBuf[0] & 0x20) ? -(pBuf[2]-256) : -pBuf[2];
+ break;
+
+ case R_GLIDEPOINT: /* Glidepoint */
+ act.buttons = ((pBuf[0] & 0x04) ? MIDDLE_BUTTON : 0) |
+ ((pBuf[0] & 0x02) ? RIGHT_BUTTON : 0) |
+ (((pBuf[0] & 0x01) ||
+ ((pBuf[0] & 0x08) == 0)) ? LEFT_BUTTON : 0);
+
act.dx = (pBuf[0] & 0x10) ? pBuf[1]-256 : pBuf[1];
act.dy = (pBuf[0] & 0x20) ? -(pBuf[2]-256) : -pBuf[2];
break;
>Audit-Trail:
>Unformatted:
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703182102.QAA07943>
