Category : Tutorials + Patches
Archive   : ZIP-3-2.ZIP
Filename : MOUSDEMO.C

 
Output of file : MOUSDEMO.C contained in archive : ZIP-3-2.ZIP
/******************/
/* Mouse Demo */
/* by */
/* Ron Balewski */
/******************/

#include /* REGS registers */
#include
#include

main()
{
int exitflag;
union REGS regs;

clrscr();
regs.x.ax = 0; /* Function 0: */
int86(0x33, ®s, ®s); /* Test mouse status */

if (regs.x.ax != 0xffff) /* Test for good mouse */
{
printf("\n\nMouse problem!!! \n\n\n");
exit(8);
}


gotoxy(1, 1);
printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n" /* Draw */
"º Mouse Statistics º\n" /* Pretty */
"ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\n" /* Screen */
"º º\n"
"º ÚÄÄÄÄÄÄPositionÄÄÄÄÄÄ º\n"
"º ³ ³ º\n"
"º ³ Horizontal -> ³ º\n"
"º ³ Vertical -> ³ º\n"
"º ³ ³ º\n"
"º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º\n"
"º º\n"
"º ÚÄÄÄÄÄÄÄButtonsÄÄÄÄÄÄ º\n"
"º ³ ³ º\n"
"º ³ Left ---> ³ º\n"
"º ³ Center -> ³ º\n"
"º ³ Right --> ³ º\n"
"º ³ ³ º\n"
"º ÃÄÄ 'X' = Pressed ÄÄ´ º\n"
"º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º\n"
"º º\n"
"ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");

gotoxy(60, 20);
printf("ÉÍÍÍÍÍÍÍÍ»");
gotoxy(60, 21);
printf("º º");
gotoxy(60, 22);
printf("º EXIT º");
gotoxy(60, 23);
printf("º º");
gotoxy(60, 24);
printf("ÈÍÍÍÍÍÍÍÍ");


regs.x.ax = 1; /* Function 1: */
int86(0x33, ®s, ®s); /* Turn on mouse cursor */

exitflag = 0;
while (exitflag == 0)
{

regs.x.ax = 3; /* Function 3: */
int86(0x33, ®s, ®s); /* Read mouse position */

gotoxy(19, 7); /* Print horiz. position */
printf("%3d", regs.x.cx);

gotoxy(19, 8); /* Print vert. position */
printf("%3d", regs.x.dx);


gotoxy(19, 14); /* Test left button */
if ((regs.x.bx & 0x01) == 0x01)
putchar('X');
else
putchar(' ');

gotoxy(19, 15); /* Test center button */
if ((regs.x.bx & 0x04) == 0x04)
putchar('X');
else
putchar(' ');

gotoxy(19, 16); /* Test right button */
if ((regs.x.bx & 0x02) == 0x02)
putchar('X');
else
putchar(' ');


/* Now we'll check for the EXIT by watching for a left button */
/* click, then checking for the location. We'll use function 5 */
/* for this. We don't have to do this, since we already have */
/* the button status & location. But we'll do it anyway for */
/* demonstration purposes. */


regs.x.ax = 5; /* Function 5: */
regs.x.bx = 0; /* Left button */ /* Get button press info */
int86(0x33, ®s, ®s);

if ((regs.x.cx>472)&&(regs.x.cx<544)&&
(regs.x.dx>152)&&(regs.x.dx<184))
exitflag = 1;
}
regs.x.ax = 0; /* We've got to reset the mouse */
int86(0x33, ®s, ®s); /* or the cursor will stay visible! */
}


  3 Responses to “Category : Tutorials + Patches
Archive   : ZIP-3-2.ZIP
Filename : MOUSDEMO.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/