home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / nicol / sti_keys / sti_kdem.pas next >
Encoding:
Pascal/Delphi Source File  |  1980-01-01  |  1.6 KB  |  36 lines

  1. program STI_KDEM;                           { demonstration of the STI_KEYS }
  2.                                             { unit                          }
  3. Uses
  4.    CRT,                                     { standard unit                 }
  5.    STI_KEYS;                                { the STI_KEYS unit             }
  6.  
  7. Var
  8.   InKeys : KeyRec;                          { a record for keystrokes       }
  9.  
  10. {---------------------------------------------------------------------------}
  11.  
  12. procedure Explain;                          { explain whats going on        }
  13.  
  14. begin
  15.   writeln('                          STI_KDEM');
  16.   writeln('');
  17.   writeln('             This is an example of the codes returned from');
  18.   writeln('             the STI_KEYS unit. Press combinations of keys');
  19.   writeln('             to see what happens.');
  20. end;
  21.  
  22. {---------------------------------------------------------------------------}
  23.  
  24. begin
  25.   ClrScr;                                   { clear the screen              }
  26.   Explain;                                  { explain whats happening       }
  27.   repeat                                    { loop and get keys then show   }
  28.     begin                                   { what is happening             }
  29.       InKeys := STI_InKey3;
  30.       GotoXY(1,10); Write('Byte 1 : ',InKeys[1],' : ',ord(InKeys[1]),'     ');
  31.       GotoXY(1,11); Write('Byte 2 : '         ,'  : ',ord(InKeys[2]),'     ');
  32.       GotoXY(1,12); Write('Byte 3 : '         ,'  : ',ord(InKeys[3]),'     ');
  33.     end;
  34.   until InKeys[1] = #27;
  35.   ClrScr;                                   { clear the screen              }
  36. end.