首页  编辑  

在TC2。0中要怎么样调用鼠标

Tags: /超级猛料/Hardware.硬件相关/键盘和鼠标/   Date Created:

]、。·ˉˇ¨〃々—~‖…’”〕〉》」』〗】∶!"'),.:;?]` 下面这些,基本够用了吧。

char initmouse();

void showmouse();

void hidemouse();

void readmouse(int *f,int *x,int *y);

void setmousecoord(int x,int y);

void setmousearea(int,int,int,int);

void mousehidearea(int,int,int,int);

char leftprsd();

char rightprsd();

void errmsg();

char initmouse()

{ union REGS inr,outr;

inr.x.ax=0;

int86(0x33,&inr,&outr);

return outr.x.ax;

}

void showmouse()

{ union REGS inr,outr;

inr.x.ax=1;

int86(0x33,&inr,&outr);

}

void hidemouse()

{ union REGS inr,outr;

inr.x.ax=2;

int86(0x33,&inr,&outr);

}

void readmouse(int *f,int *x,int *y)

{ union REGS inr,outr;

inr.x.ax=3;;

int86(0x33,&inr,&outr);

*f=outr.x.bx;

*x=outr.x.cx;

*y=outr.x.dx;

}

char leftprsd()

{ union REGS inr,outr;

inr.x.ax=3;

int86(0x33,&inr,&outr);

return(outr.x.bx&1);

}

void errmsg()

{ printf("Error! No mouse detected.\nPlease install mouse first!");

getch();

quit();

}

int mouseinbox(int x1,int y1,int x2,int y2,int x,int y)

{ return((x>=x1&&x<=x2&&y>=y1&&y<=y2)?1:0);

}

/*************************** End of mouse.h *******************************/