Mail Archives: djgpp/1998/08/25/16:15:38
Xavier DUBOZ wrote:
> I would like to know what is the syntaxe for mouse's input
Here is a copy of my mouse driver!
//init stuff:
Regs.x.ax=2;
__dpmi_int(0x33,&Regs); //hide cursor
Regs.x.ax=4;
Regs.x.cx=600;
Regs.x.dx=400;
__dpmi_int(0x33,&Regs); //set mousepos
mouseX=600;
mouseY=400;
Regs.x.ax=7;
Regs.x.cx=0<<3; // take coordinate times 8 (This is a problem i hawe,
meady you can solve it for me? the mouse mover 8 stepps at a time)
Regs.x.dx=320<<3;
__dpmi_int(0x33,&Regs); //set xboundaries
Regs.x.ax=8;
Regs.x.cx=0<<3;
Regs.x.dx=200<<3;
__dpmi_int(0x33,&Regs); //set yboundaries
and then read from the mouse! :
Regs.x.ax=3;
__dpmi_int(0x33,&Regs);
mouseX=Regs.x.cx>>3;
mouseY=Regs.x.dx>>3;
if(Regs.x.bx & 1)
left button pressed
if(Regs.x.bx & 2)
right button pressed
if(Regs.x.bx & 4)
middle button pressed
- Raw text -