home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ADC_TP3.ZIP / FUNCKEYS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-03-01  |  853 b   |  28 lines

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