Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 1996 23:17:11 -0400 (EDT)
From:      "Louis A. Mamakos"louie@TransSys.COM
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1827: support of Glidepoint trackpad for moused
Message-ID:  <199610170317.XAA21850@whizzo.transsys.com>
Resent-Message-ID: <199610170320.UAA28446@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1827
>Category:       bin
>Synopsis:       add support of Glidepoint trackpad "tap/drag" to moused
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 16 20:20:02 PDT 1996
>Last-Modified:
>Originator:     Louis Mamakos
>Organization:
part-time freebsd hacker
>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

XFree86, with Glidepoint Trackpad pointing device, or Glidepoint Trackpad
keyboard with integral pointing device.  

>Description:

The Glidepoint pointing device, available from Alps and other vendors
is compatible with a PS/2 mouse.   Unlike a mouse or a trackball, you
move your finger around on a rectangular a surface which causes 
pointing device motion.  The device is also equipped (depending on
the model and manufacturer) two or three mouse buttons.  Additionally,
the user can "tap" the pointing surface.

The Trackpad pointing device has a "tap" and "drag" feature where
a tap gesture is reported to the driver and should be interpreted as
a single click of the left button.  A "double-tap and drag" should
be treated as moving the pointing device with the left button held
down.

It's much nicer to use than to describe...

I reverse engineered this behavior of the device a while ago, and 
made similar modifications to the XFree86 server.  No proprietary
or confidential information was obtained from the manufacturer.

Also, please note that moused requires the use of the non-blocking
version of the mouse device.  For the PS/2 driver, this requires
having MINOR(dev)==0 rather than 1 as it is now.  I hestitate to
modify the MAKEDEV script as this would break existing users of
/dev/psm0.  My /dev looks like this:

crw-------  1 root  wheel   21,   1 Oct 16 22:26 /dev/npsm0
crw-------  1 root  wheel   21,   0 Oct 16 22:26 /dev/psm0

where moused would use /dev/psm0, and the X server (while not
using moused) would use /dev/npsm0.

Also, the moused usage message can be automatically generated
rather than hardcoded.

>How-To-Repeat:

Own one of these things, and wonder why it works so much better in
Windows than under X.

>Fix:
	
Apply these diffs to moused(8), and the sysconfig script:

--- /usr/src/usr.sbin/moused/moused.c	Thu Sep 26 23:38:48 1996
+++ moused.c	Wed Oct 16 22:30:25 1996
@@ -72,6 +72,7 @@
 #define R_LOGIMAN	6
 #define R_PS_2		7
 #define R_MMHITAB	8
+#define	R_GLIDEPOINT	9
 
 char	*rnames[] = {
     "xxx",
@@ -83,6 +84,7 @@
     "mouseman",
     "ps/2",
     "mmhitab",
+    "glidepoint",
     NULL
 };
 
@@ -97,6 +99,7 @@
     (CS7		   | CREAD | CLOCAL | HUPCL ),	/* MouseMan */
     0,							/* PS/2 */
     (CS8		   | CREAD | CLOCAL | HUPCL ),	/* MMHitTablet */
+    0,							/* Glidepoint */
 };
 
     
@@ -215,6 +218,7 @@
 	    rodent.portname = "/dev/mse0";
 	break;
     case R_PS_2:
+    case R_GLIDEPOINT:
 	if (!rodent.portname)
 	    rodent.portname = "/dev/psm0";
 	break;
@@ -273,6 +277,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"
@@ -283,15 +289,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);
 }
@@ -392,7 +393,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]);
@@ -482,6 +484,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);
@@ -603,6 +606,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;

*** /usr/src/etc/sysconfig	Thu Sep 26 23:16:37 1996
--- sysconfig	Wed Oct 16 22:59:25 1996
***************
*** 47,53 ****
  saver=NO
  
  # Set to
! # {microsoft|mousesystems|mmseries|logitech|busmouse|mouseman|ps/2|mmhittab}
  # to activate system mouse cursor support (or NO for none)
  # Use 'vidcontrol -m on' command to activate it on particular screen
  mousedtype=NO
--- 47,53 ----
  saver=NO
  
  # Set to
! # {microsoft|mousesystems|mmseries|logitech|busmouse|mouseman|ps/2|mmhittab|glidepoint}
  # to activate system mouse cursor support (or NO for none)
  # Use 'vidcontrol -m on' command to activate it on particular screen
  mousedtype=NO


>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610170317.XAA21850>