home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / testmous.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-11-20  |  1.2 KB  |  40 lines

  1. program TestMouse;
  2. { test program for Mouse4 Unit, requires Mouse }
  3.  
  4. uses CRT,Mouse4;
  5.  
  6. var
  7.   Ch               : Char;
  8.   X,Y,Stat,I       : Word;
  9.  
  10. begin
  11.   WriteLn('Simple test of unit Mouse4');
  12.   if Mouse_Installed then
  13.     WriteLn('Mouse installed')
  14.   else begin
  15.     WriteLn('Mouse not installed'); { if mouse hardware and          }
  16.     Halt                            { software not found, then abort }
  17.   end;
  18.   ShowMouse; { Display Mouse cursor as block }
  19.   repeat  { Loop until key or button pressed }
  20.     Stat := MousePosition(X,Y);
  21.     WriteLn('Mouse is at ',X,',',Y,' status = ',Stat);
  22.     Delay(500) { now just wait halfa second }
  23.   until (Stat <> 0) or KeyPressed;
  24.   if KeyPressed then Ch := ReadKey;
  25.   ClrScr;
  26.   WriteLn;
  27.   WriteLn('SetMouseXY(20,12,60,24)');
  28.   ShowMouse;
  29.   setmousexy(20,12,60,24); { confine that rodent }
  30.   SetPixelToMickey(24,48); { change the sensitivity of the mouse }
  31.   repeat { Loop until key or button pressed }
  32.     Stat := MousePosition(X,Y);
  33.     WriteLn('Mouse is at ',X,',',Y,' status = ',Stat);
  34.     Delay(500)
  35.   until (Stat <> 0) or KeyPressed;
  36.   if KeyPressed then Ch := ReadKey;
  37.   RestoreMouseXy; { give whole screen back to mouse }
  38.   HideMouse;      { Hide mouse cursor }
  39. end.
  40.