谢谢!!!
我刚刚搬家回来(不知道还有那位老朋友记得我在暑假的时候说过要搬家) 呵呵 随便写了个给你,只有最简单的功能 #include <stdio.h> #include <dos.h> #include <graphics.h> #include <bios.h>
#define fRIGHT 0x4d00 #define fLEFT 0x4b00 #define fUP 0x4800 #define fDOWN 0x5000 #define fESC 0x001b
union REGS regs; int mx,my;
void readmouse() { regs.x.ax=3; int86(51,®s,®s); mx=regs.x.cx; my=regs.x.dx; }
void setmousexy() { regs.x.ax=4; regs.x.cx=mx; regs.x.dx=my; int86(51,®s,®s); }
/*无暂停按键控制器*/ int funkey() { unsigned key; if(bioskey(1)==0) return(0); key=bioskey(0); if(key<<8) key=key&0x00ff; return key; }
void main() { int key; int graphdriver=DETECT; int graphmode;
initgraph(&graphdriver,&graphmode,""); getch(); while( (key=funkey()) != fESC) { readmouse(); switch(key) { case fUP :my--;setmousexy();break; case fDOWN :my++;setmousexy();break; case fLEFT :mx--;setmousexy();break; case fRIGHT :mx++;setmousexy();break; } circle(mx,my,10); } } 很抱歉,没有注释,如果想要,明天给你