home *** CD-ROM | disk | FTP | other *** search
- program TestMouse;
- { test program for Mouse4 Unit, requires Mouse }
-
- uses CRT,Mouse4;
-
- var
- Ch : Char;
- X,Y,Stat,I : Word;
-
- begin
- WriteLn('Simple test of unit Mouse4');
- if Mouse_Installed then
- WriteLn('Mouse installed')
- else begin
- WriteLn('Mouse not installed'); { if mouse hardware and }
- Halt { software not found, then abort }
- end;
- ShowMouse; { Display Mouse cursor as block }
- repeat { Loop until key or button pressed }
- Stat := MousePosition(X,Y);
- WriteLn('Mouse is at ',X,',',Y,' status = ',Stat);
- Delay(500) { now just wait halfa second }
- until (Stat <> 0) or KeyPressed;
- if KeyPressed then Ch := ReadKey;
- ClrScr;
- WriteLn;
- WriteLn('SetMouseXY(20,12,60,24)');
- ShowMouse;
- setmousexy(20,12,60,24); { confine that rodent }
- SetPixelToMickey(24,48); { change the sensitivity of the mouse }
- repeat { Loop until key or button pressed }
- Stat := MousePosition(X,Y);
- WriteLn('Mouse is at ',X,',',Y,' status = ',Stat);
- Delay(500)
- until (Stat <> 0) or KeyPressed;
- if KeyPressed then Ch := ReadKey;
- RestoreMouseXy; { give whole screen back to mouse }
- HideMouse; { Hide mouse cursor }
- end.