home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol291 / funckeys.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-12-22  |  823 b   |  26 lines

  1. program GetFunctionKeyData;
  2. {
  3.         This program looks at keyboard input to see if a key was hit that
  4.         generates a two-character sequence.  On most keyboards, these two
  5.         characters consist of chr(27) [ESC] plus an alphanumeric char.
  6. }
  7. var
  8.   Ch                   : Char;
  9.   Previous             : Boolean;
  10.   Count                : Integer;
  11.  
  12. begin
  13.   for Count := 1 to 20 do begin
  14.     Read(Kbd,Ch);              { Read a character, if ESC (chr(27) then }
  15.     if Ch = chr(27) then begin { keystroke must be either ESC key or one }
  16.       Previous := True;        { that generates a two-digit code }
  17.       Read(Kbd,Ch);
  18.     end
  19.     else Previous := False;
  20.     if Previous
  21.       then Write('previous ')
  22.       else Write('single char ');
  23.     WriteLn('Ord(Ch)= ',Ord(Ch))
  24.   end
  25. end. { of program GetFunctionKeyData }
  26.