#include "Stdio.h"
#include "Conio.h"
#include "dos.h"
typedef unsigned char BYTE;
BYTE getmouse(BYTE *x,BYTE *y)
{
_AH=4;
geninterrupt(0x10);
*x=_DL+1;
*y=_DH+1;
return (_AH);
}
int main(void)
{
BYTE x,y,ux=1,uy=1,uisP=0;
BYTE isP;
unsigned int schar;
while(!kbhit())
{
isP=getmouse(&x,&y);
if((x!=ux)||(y!=uy)||(isP!=uisP))
{
gotoxy(1,1);
printf("%u,%u \n",x,y);
if(isP==1)
{
printf("Pressed \n");
gotoxy(x,y);
putch(219);
}
else
{
printf("Unpressed \n");
}
ux=x;
uy=y;
uisP=isP;
}
}
getch();
clrscr();
return 0;
}
这个可以,不过是tc下的