Patch for MS Bus mouse for Roell's X11r4
James Van Artsdalen
james at bigtex.cactus.org
Mon Oct 22 17:49:53 AEST 1990
Here's a hack that seems to make the Microsoft Bus mouse work with
Roell's X11r4 port. Use "-4 -dev /dev/mouse" to tell the server it's
a Bus mouse and that it's on /dev/mouse.
*** /tmp/,RCSt1a04103 Sun Oct 21 20:07:25 1990
--- mit/server/ddx/ibm/common/ibmCmdArgs.c Sun Oct 21 18:32:57 1990
***************
*** 335,340 ****
--- 335,348 ----
}
static int
+ selectMSBus(myArg)
+ char **myArg;
+ {
+ SYSVMouseType = MicroSoftBus;
+ return 1;
+ }
+
+ static int
selectMSM ( myArg )
char **myArg ;
{
***************
*** 431,436 ****
--- 439,447 ----
{ "-3",
" -3 select MouseSystems Mouse (default)\n",
selectMSM },
+ { "-4",
+ " -4 select Microsoft Bus mouse\n",
+ selectMSBus },
{ "-dev",
" -dev <path> specify the mouse-device (default: /dev/tty00)\n",
mousedev },
*** /tmp/,RCSt1a04108 Sun Oct 21 20:07:25 1990
--- mit/server/ddx/ibm/SYSV/OSio.h Sun Oct 21 20:06:57 1990
***************
*** 69,74 ****
--- 69,75 ----
#define MicroSoft 1
#define MouseSystems 0
+ #define MicroSoftBus 2
extern int SYSVDefaultDisplay ;
***************
*** 81,86 ****
--- 82,88 ----
extern int SYSVMouseType;
extern int MSMPtrEvent();
extern int MSPtrEvent();
+ extern int MSBusPtrEvent();
extern int (* SYSVPtrEvents)();
extern int SYSVMouseState;
*** /tmp/,RCSt1a04113 Sun Oct 21 20:07:26 1990
--- mit/server/ddx/ibm/SYSV/SYSVMouse.c Sun Oct 21 18:29:10 1990
***************
*** 135,140 ****
--- 135,149 ----
ioctl(SYSVmouseFd,TCSETA,&tty);
SYSVPtrEvents = MSPtrEvent;
break;
+
+ case MicroSoftBus:
+ if ((SYSVmouseFd= open(SYSVPtrDev,O_RDONLY | O_NDELAY)) < 0)
+ {
+ Error ("Opening MicroSoftBusMouse");
+ return (!Success);
+ }
+ SYSVPtrEvents = MSBusPtrEvent;
+ break;
}}
SYSVMouseState = 0;
*** /tmp/,RCSt1a04118 Sun Oct 21 20:07:27 1990
--- mit/server/ddx/ibm/SYSV/SYSVEvents.c Sun Oct 21 18:41:36 1990
***************
*** 497,502 ****
--- 497,596 ----
}
+ /***====================================================================***/
+
+ int
+ MSBusPtrEvent()
+ {
+ extern int SYSVMouseChordDelay;
+ static int buttons;
+ static int DeltaX,DeltaY;
+ xEvent e;
+ int i,nBytes;
+ unsigned char rBuf[64];
+ int changed;
+
+ nBytes = read (SYSVmouseFd, &rBuf, 64);
+ if (nBytes == 0)
+ return(0);
+
+ for (i = 0; i < nBytes; i++)
+ {
+ switch (SYSVMouseState)
+ {
+ case 0:
+ if ((rBuf[i] & 0xF8) == 0x80)
+ {
+ buttons = (~rBuf[i]) & 0x07;
+ SYSVMouseState++;
+ }
+ break;
+
+ case 1:
+ DeltaX = (signed char) rBuf[i];
+ SYSVMouseState++;
+ break;
+
+ case 2:
+ DeltaY = (signed char) rBuf[i];
+ SYSVMouseState++;
+ break;
+
+ case 3:
+ SYSVMouseState++;
+ break;
+
+ case 4:
+ SYSVMouseState=0;
+ break;
+ }
+
+ if (SYSVMouseState == 0)
+ {
+ TRACE (("MSM_PtrEvent (%d,%d)\n", DeltaX,DeltaY));
+ pendingX += DeltaX;
+ pendingY += DeltaY;
+
+ if (pendingX || pendingY)
+ SYSVFlushMouse ();
+ e.u.keyButtonPointer.rootX = SYSVCurrentX;
+ e.u.keyButtonPointer.rootY = SYSVCurrentY;
+ e.u.keyButtonPointer.time = GET_OS_TIME();
+
+ changed = buttons ^ lastButtons;
+ if (changed & MSM_LBUTTON)
+ {
+ if (buttons & MSM_LBUTTON)
+ e.u.u.type = DOWN;
+ else
+ e.u.u.type = UP;
+ e.u.u.detail= LEFT;
+ (*ibmPtr->processInputProc)(&e,ibmPtr,1);
+ }
+ if (changed & MSM_RBUTTON)
+ {
+ if (buttons & MSM_RBUTTON)
+ e.u.u.type = DOWN;
+ else
+ e.u.u.type = UP;
+ e.u.u.detail= RIGHT;
+ (*ibmPtr->processInputProc)(&e,ibmPtr,1);
+ }
+ if (changed & MSM_MBUTTON)
+ {
+ if (buttons & MSM_MBUTTON)
+ e.u.u.type = DOWN;
+ else
+ e.u.u.type = UP;
+ e.u.u.detail= MIDDLE;
+ (*ibmPtr->processInputProc)(&e,ibmPtr,1);
+ }
+ lastButtons = buttons;
+ }
+ }
+ return(nBytes);
+ }
+
/***====================================================================***/
--
James R. Van Artsdalen james at bigtex.cactus.org "Live Free or Die"
Dell Computer Co 9505 Arboretum Blvd Austin TX 78759 512-338-8789
More information about the Comp.unix.sysv386
mailing list