unit runmouse; interface uses dos,crt; procedure ResetMouse; procedure ShowMouseCursor; procedure HideMouseCursor; procedure ReadMouseStatus(var x,y :word;var LBut,MBut,RBut:boolean); procedure MoveMouseCursor(x,y:integer); Procedure MouseGraphCursor(var ScrCurMask;x,y: Byte); function LeftButtonDown: boolean; function RightButtonDown: boolean; function MouseIn(x1,y1,x2,y2 :word): boolean; procedure MouseScreen(x1,y1,x2,y2 :word); procedure SetMouseOptions(hor,ver,porog:word); procedure SetSpeedMouse(mikkiS:word); Var WasClick, WasHit: boolean; ClickX, ClickY: word; implementation procedure setspeedmouse(mikkiS:word); assembler; asm mov ax,$13 mov dx,mikkiS end; procedure setMouseoptions(hor,ver,porog:word); assembler; asm mov ax,$1A mov bx,hor mov cx,ver mov dx,porog int $33 end; procedure mousegraphcursor(var scrcurmask;x,y: Byte); var reg:registers; begin with Reg do begin ax := $9; bx := X; cx := Y; es := seg(scrcurmask); dx := ofs(scrcurmask); intr($33,reg) end end; function mousein(x1,y1,x2,y2: word):boolean; var rdx,rcx:word; begin asm mov ax,$03 int $33 mov rdx,dx mov rcx,cx end; mousein := (rcx>=x1) and (rcx<=x2) and (rdx>=y1) and (rdx<=y2) end; procedure mousescreen(x1,y1,x2,y2 : word); begin asm mov ax,7 mov cx,x1 mov dx,x2 int 33h mov ax,8 mov cx,y1 mov dx,y2 int 33h end; end; procedure resetmouse; var r: registers; begin r.ax:=0; Intr($33,r); end; procedure showmousecursor; var r:registers; begin r.ax:=1; Intr($33,r); end; procedure hidemousecursor; var r:registers; begin r.ax:=2; Intr($33,r); end; procedure readmousestatus(var x,y :word;var LBut,MBut,RBut:boolean); var r:registers; begin r.ax:=3; Intr($33,r); x:=r.cx; y:=r.dx; LBut:=(r.bx and 1)<>0; RBut:=(r.bx and 2)<>0; MBut:=(r.bx and 4)<>0; end; function leftbuttondown: boolean; var r:registers; begin r.ax:=3; Intr($33,r); leftbuttondown:=(r.bx and 1)<>0; end; function rightbuttondown: boolean; var r:registers; begin r.ax:=3; Intr($33,r); rightbuttondown:=(r.bx and 2)<>0; end; procedure movemousecursor(x,y:integer); var r:registers; begin r.ax:=4; r.cx:=x; r.dx:=y; Intr($33,r); end; end.