Deleted Added
full compact
moused.c (81364) moused.c (93071)
1/**
2 ** Copyright (c) 1995 Michael Smith, All rights reserved.
3 **
4 ** Redistribution and use in source and binary forms, with or without
5 ** modification, are permitted provided that the following conditions
6 ** are met:
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer as

--- 32 unchanged lines hidden (view full) ---

41 ** The mouse interface functions are derived closely from the mouse
42 ** handler in the XFree86 X server. Many thanks to the XFree86 people
43 ** for their great work!
44 **
45 **/
46
47#ifndef lint
48static const char rcsid[] =
1/**
2 ** Copyright (c) 1995 Michael Smith, All rights reserved.
3 **
4 ** Redistribution and use in source and binary forms, with or without
5 ** modification, are permitted provided that the following conditions
6 ** are met:
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer as

--- 32 unchanged lines hidden (view full) ---

41 ** The mouse interface functions are derived closely from the mouse
42 ** handler in the XFree86 X server. Many thanks to the XFree86 people
43 ** for their great work!
44 **
45 **/
46
47#ifndef lint
48static const char rcsid[] =
49 "$FreeBSD: head/usr.sbin/moused/moused.c 81364 2001-08-09 18:12:07Z dougb $";
49 "$FreeBSD: head/usr.sbin/moused/moused.c 93071 2002-03-24 03:07:07Z will $";
50#endif /* not lint */
51
52#include <ctype.h>
53#include <err.h>
54#include <errno.h>
55#include <fcntl.h>
56#include <limits.h>
57#include <stdio.h>

--- 137 unchanged lines hidden (view full) ---

195 "ps/2",
196 "mmhitab",
197 "glidepoint",
198 "intellimouse",
199 "thinkingmouse",
200 "sysmouse",
201 "x10mouseremote",
202 "kidspad",
50#endif /* not lint */
51
52#include <ctype.h>
53#include <err.h>
54#include <errno.h>
55#include <fcntl.h>
56#include <limits.h>
57#include <stdio.h>

--- 137 unchanged lines hidden (view full) ---

195 "ps/2",
196 "mmhitab",
197 "glidepoint",
198 "intellimouse",
199 "thinkingmouse",
200 "sysmouse",
201 "x10mouseremote",
202 "kidspad",
203 "versapad",
204 "jogdial",
203#if notyet
204 "mariqua",
205#endif
206 NULL
207};
208
209/* models */
210static symtab_t rmodels[] = {

--- 146 unchanged lines hidden (view full) ---

357 (CS8 | CREAD | CLOCAL | HUPCL ), /* MM HitTablet */
358 (CS7 | CREAD | CLOCAL | HUPCL ), /* GlidePoint */
359 (CS7 | CREAD | CLOCAL | HUPCL ), /* IntelliMouse */
360 (CS7 | CREAD | CLOCAL | HUPCL ), /* Thinking Mouse */
361 (CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* sysmouse */
362 (CS7 | CREAD | CLOCAL | HUPCL ), /* X10 MouseRemote */
363 (CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL ), /* kidspad etc. */
364 (CS8 | CREAD | CLOCAL | HUPCL ), /* VersaPad */
205#if notyet
206 "mariqua",
207#endif
208 NULL
209};
210
211/* models */
212static symtab_t rmodels[] = {

--- 146 unchanged lines hidden (view full) ---

359 (CS8 | CREAD | CLOCAL | HUPCL ), /* MM HitTablet */
360 (CS7 | CREAD | CLOCAL | HUPCL ), /* GlidePoint */
361 (CS7 | CREAD | CLOCAL | HUPCL ), /* IntelliMouse */
362 (CS7 | CREAD | CLOCAL | HUPCL ), /* Thinking Mouse */
363 (CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* sysmouse */
364 (CS7 | CREAD | CLOCAL | HUPCL ), /* X10 MouseRemote */
365 (CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL ), /* kidspad etc. */
366 (CS8 | CREAD | CLOCAL | HUPCL ), /* VersaPad */
367 0, /* JogDial */
365#if notyet
366 (CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* Mariqua */
367#endif
368};
369
370static struct rodentparam {
371 int flags;
372 char *portname; /* /dev/XXX */

--- 704 unchanged lines hidden (view full) ---

1077 { 0xe0, 0x80, 0x80, 0x00, 3, 0x00, 0xff }, /* MM HitTablet */
1078 { 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* GlidePoint */
1079 { 0x40, 0x40, 0x40, 0x00, 3, ~0x3f, 0x00 }, /* IntelliMouse */
1080 { 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* ThinkingMouse */
1081 { 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* sysmouse */
1082 { 0x40, 0x40, 0x40, 0x00, 3, ~0x23, 0x00 }, /* X10 MouseRem */
1083 { 0x80, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* KIDSPAD */
1084 { 0xc3, 0xc0, 0x00, 0x00, 6, 0x00, 0xff }, /* VersaPad */
368#if notyet
369 (CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* Mariqua */
370#endif
371};
372
373static struct rodentparam {
374 int flags;
375 char *portname; /* /dev/XXX */

--- 704 unchanged lines hidden (view full) ---

1080 { 0xe0, 0x80, 0x80, 0x00, 3, 0x00, 0xff }, /* MM HitTablet */
1081 { 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* GlidePoint */
1082 { 0x40, 0x40, 0x40, 0x00, 3, ~0x3f, 0x00 }, /* IntelliMouse */
1083 { 0x40, 0x40, 0x40, 0x00, 3, ~0x33, 0x00 }, /* ThinkingMouse */
1084 { 0xf8, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* sysmouse */
1085 { 0x40, 0x40, 0x40, 0x00, 3, ~0x23, 0x00 }, /* X10 MouseRem */
1086 { 0x80, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* KIDSPAD */
1087 { 0xc3, 0xc0, 0x00, 0x00, 6, 0x00, 0xff }, /* VersaPad */
1088 { 0x00, 0x00, 0x00, 0x00, 1, 0x00, 0xff }, /* JogDial */
1085#if notyet
1086 { 0xf8, 0x80, 0x00, 0x00, 5, ~0x2f, 0x10 }, /* Mariqua */
1087#endif
1088};
1089static unsigned char cur_proto[7];
1090
1091static int
1092r_identify(void)

--- 263 unchanged lines hidden (view full) ---

1356 break;
1357 read(rodent.mfd, &c, 1);
1358 debug("%c", c);
1359 if (c != *s)
1360 break;
1361 }
1362 break;
1363
1089#if notyet
1090 { 0xf8, 0x80, 0x00, 0x00, 5, ~0x2f, 0x10 }, /* Mariqua */
1091#endif
1092};
1093static unsigned char cur_proto[7];
1094
1095static int
1096r_identify(void)

--- 263 unchanged lines hidden (view full) ---

1360 break;
1361 read(rodent.mfd, &c, 1);
1362 debug("%c", c);
1363 if (c != *s)
1364 break;
1365 }
1366 break;
1367
1368 case MOUSE_PROTO_JOGDIAL:
1369 break;
1364 case MOUSE_PROTO_MSC:
1365 setmousespeed(1200, rodent.baudrate, rodentcflags[rodent.rtype]);
1366 if (rodent.flags & ClearDTR) {
1367 i = TIOCM_DTR;
1368 ioctl(rodent.mfd, TIOCMBIC, &i);
1369 }
1370 if (rodent.flags & ClearRTS) {
1371 i = TIOCM_RTS;

--- 241 unchanged lines hidden (view full) ---

1613 act->button = (1 << (rBuf - 13))
1614 | (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN));
1615 /*
1616 * FIXME: this is a button "down" event. There needs to be
1617 * a corresponding button "up" event... XXX
1618 */
1619 break;
1620#endif /* notyet */
1370 case MOUSE_PROTO_MSC:
1371 setmousespeed(1200, rodent.baudrate, rodentcflags[rodent.rtype]);
1372 if (rodent.flags & ClearDTR) {
1373 i = TIOCM_DTR;
1374 ioctl(rodent.mfd, TIOCMBIC, &i);
1375 }
1376 if (rodent.flags & ClearRTS) {
1377 i = TIOCM_RTS;

--- 241 unchanged lines hidden (view full) ---

1619 act->button = (1 << (rBuf - 13))
1620 | (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN));
1621 /*
1622 * FIXME: this is a button "down" event. There needs to be
1623 * a corresponding button "up" event... XXX
1624 */
1625 break;
1626#endif /* notyet */
1627 case MOUSE_PROTO_JOGDIAL:
1628 break;
1621
1622 /*
1623 * IntelliMouse, NetMouse (including NetMouse Pro) and Mie Mouse
1624 * always send the fourth byte, whereas the fourth byte is
1625 * optional for GlidePoint and ThinkingMouse. The fourth byte
1626 * is also optional for MouseMan+ and FirstMouse+ in their
1627 * native mode. It is always sent if they are in the IntelliMouse
1628 * compatible mode.

--- 82 unchanged lines hidden (view full) ---

1711 case MOUSE_PROTO_MSC: /* MouseSystems Corp */
1712#if notyet
1713 case MOUSE_PROTO_MARIQUA: /* Mariqua */
1714#endif
1715 act->button = butmapmsc[(~pBuf[0]) & MOUSE_MSC_BUTTONS];
1716 act->dx = (char)(pBuf[1]) + (char)(pBuf[3]);
1717 act->dy = - ((char)(pBuf[2]) + (char)(pBuf[4]));
1718 break;
1629
1630 /*
1631 * IntelliMouse, NetMouse (including NetMouse Pro) and Mie Mouse
1632 * always send the fourth byte, whereas the fourth byte is
1633 * optional for GlidePoint and ThinkingMouse. The fourth byte
1634 * is also optional for MouseMan+ and FirstMouse+ in their
1635 * native mode. It is always sent if they are in the IntelliMouse
1636 * compatible mode.

--- 82 unchanged lines hidden (view full) ---

1719 case MOUSE_PROTO_MSC: /* MouseSystems Corp */
1720#if notyet
1721 case MOUSE_PROTO_MARIQUA: /* Mariqua */
1722#endif
1723 act->button = butmapmsc[(~pBuf[0]) & MOUSE_MSC_BUTTONS];
1724 act->dx = (char)(pBuf[1]) + (char)(pBuf[3]);
1725 act->dy = - ((char)(pBuf[2]) + (char)(pBuf[4]));
1726 break;
1719
1727
1728 case MOUSE_PROTO_JOGDIAL: /* JogDial */
1729 if (rBuf == 0x6c)
1730 act->dz=-1;
1731 if (rBuf == 0x72)
1732 act->dz=1;
1733 if (rBuf == 0x64)
1734 act->button = MOUSE_BUTTON1DOWN;
1735 if (rBuf == 0x75)
1736 act->button = 0;
1737 break;
1738
1720 case MOUSE_PROTO_HITTAB: /* MM HitTablet */
1721 act->button = butmaphit[pBuf[0] & 0x07];
1722 act->dx = (pBuf[0] & MOUSE_MM_XPOSITIVE) ? pBuf[1] : - pBuf[1];
1723 act->dy = (pBuf[0] & MOUSE_MM_YPOSITIVE) ? - pBuf[2] : pBuf[2];
1724 break;
1725
1726 case MOUSE_PROTO_MM: /* MM Series */
1727 case MOUSE_PROTO_LOGI: /* Logitech Mice */

--- 1215 unchanged lines hidden ---
1739 case MOUSE_PROTO_HITTAB: /* MM HitTablet */
1740 act->button = butmaphit[pBuf[0] & 0x07];
1741 act->dx = (pBuf[0] & MOUSE_MM_XPOSITIVE) ? pBuf[1] : - pBuf[1];
1742 act->dy = (pBuf[0] & MOUSE_MM_YPOSITIVE) ? - pBuf[2] : pBuf[2];
1743 break;
1744
1745 case MOUSE_PROTO_MM: /* MM Series */
1746 case MOUSE_PROTO_LOGI: /* Logitech Mice */

--- 1215 unchanged lines hidden ---