home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMIN4.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  2KB  |  81 lines

  1. Program DemoInputFour;
  2. {DEMIN4}
  3.  
  4. Uses CRT,
  5.      totINPUT, totFAST, totSTR;
  6.  
  7. Var
  8.   Ch : char;
  9.   L,C,R,OldL,OldC,OldR: boolean;
  10.   X,Y,OldX,OldY: byte;
  11.  
  12. begin                 
  13.    Clrscr;
  14.    with Mouse do
  15.    begin
  16.       if not Installed then
  17.       begin
  18.          Writeln('This demo will only function on systems equipped with a mouse');
  19.       end
  20.       else
  21.       begin
  22.          WriteLn('You have a ',GetButtons,' button mouse!');
  23.          Writeln('Press: C to confine the mouse');
  24.          Writeln('       U to unconfine the mouse');
  25.          Writeln('       L to change the mouse cursor');
  26.          Writeln('       R to reset mouse');
  27.          Writeln('       H to hide the mouse');
  28.          Writeln('       S to show the mouse');
  29.          Writeln('       any mouse button');
  30.          Writeln('       Esc to quit');
  31.          Screen.FillBox(15,10,65,20,30,1);
  32.          Show;
  33.          repeat
  34.             with Screen do
  35.             repeat
  36.                Status(L,C,R,X,Y);
  37.                if OldL <> L then
  38.                   if L then
  39.                      WriteAT(20,11,30,'Left Button')
  40.                   else
  41.                      WriteAT(20,11,30,'           ');
  42.                if OldR <> R then
  43.                   if R then
  44.                      WriteAT(20,12,30,'Right Button')
  45.                   else
  46.                      WriteAT(20,12,30,'            ');
  47.                if OldC <> C then
  48.                   if C then
  49.                      WriteAT(20,13,30,'Middle Button')
  50.                   else
  51.                      WriteAT(20,13,30,'             ');
  52.                if OldX <> X then
  53.                   WriteAT(20,15,30,inttostr(X)+' ');
  54.                if OldY <> Y then
  55.                    WriteAT(20,16,30,inttostr(Y)+' ');
  56.                OldL := L;
  57.                OldR := R;
  58.                OldC := C;
  59.                OldX := X;
  60.                OldY := Y;
  61.             until Key.KeyPressed;
  62.             Key.GetInput;
  63.             case upcase(Key.LastChar) of
  64.                'C': Confine(15,10,65,20);
  65.                'U': Confine(1,1,80,25);
  66.                'L': SetMouseCursorStyle(random(200)+56,0);
  67.                'H': Hide;
  68.                'S': Show;
  69.                'R': begin
  70.                        Hide;
  71.                        Reset;
  72.                        Show;
  73.                     end;
  74.             end; {case}
  75.          until Key.LastKey = 27;
  76.          Hide;
  77.       end;
  78.       GotoXY(1,23);
  79.    end;
  80. end.
  81.