Category : C Source Code
Archive   : TCMOUSE.ZIP
Filename : MOUSE.INC
/* Must #include dos.h before this #include to define the */
/* register set used to pass args to device driver. */
/* Define int for device driver */
#define callMDD int86(0x33, &inreg, &outreg)
/* Define sorting macros used locally */
#define lower (x,y) (x,y)?x:y
#define upper (x,y) (x>y)?x:y
/* STATIC REGISTERS USED THROURGOUT */
union REGS inreg, outreg;
/* Structures used by these functions */
typedef struct {
int exists,
nButtons;
} resetRec;
typedef struct {
int buttonStatus,
opCount,
column, row;
} locRec;
typedef struct {
int hCount,
vCount;
} moveRec;
/* Following are Implementations of Microsoft Mouse Functions */
resetRec *mReset()
/* Resets mouse to default state. Returns pointer to a structure */
/* indicating whether or not mouse is installed and, if so, how */
/* many buttons it has */
/* Always call this function during initialization. */
{
static resetRec m;
inreg.x.ax = 0;
callMDD;
m.exists = outreg.x.ax;
m.nButtons = outreg.x.bx;
return(&m);
}
void mShow(void)
/* Makes the cursor visible. Don't call if cursor is already */
/* visible, and alternate calls to mHide. */
{
inreg.x.ax = 1;
callMDD;
}
void mHide(void)
/* Makes mouse cursor invisible, still tracks location. Alternate calls */
/* with mShow. Do not call if already hidden. */
{
inreg.x.ax = 2;
callMDD;
}
locRec *mPos(void)
/* Gets mouse cursor position and button status, returns pointer */
/* to structure containing this info. */
{
static locRec m;
inreg.x.ax = 3; /* Function 3 */
callMDD;
m.buttonStatus = outreg.x.bx; /* Button Status */
m.column = outreg.x.cx; /* Horizontal Position */
m.row = outreg.x.dx; /* Vertical Position */
return (&m);
}
void mMoveto (int newCol, int newRow)
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/