home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB33.ZIP / RDIBMKBD.INC < prev    next >
Encoding:
Text File  |  1986-02-09  |  1.6 KB  |  45 lines

  1. (*******************************************************************)
  2. (*  this procedure reads the IBM keyboard.  Cursor keys are        *)
  3. (*  returned as control keys.  Extended function keys are          *)
  4. (*  returned as ASCII chars <131-140> The extra escape character   *)
  5. (*  is eliminated.                                                 *)
  6. (*  REMEMBER:  The USER INTERUPT COMPILER DIRECTIVE MUST BE        *)
  7. (*             PASSIVE ($U-) FOR THIS ROUTINE TO WORK.             *)
  8. (*******************************************************************)
  9. procedure ReadIBMch(var ch: char);
  10. var   ech: char;
  11. begin  {  ReadIBMch  }
  12.   ch := #00;
  13.   Read(kbd,ch);
  14.   if (ch = ^[) and KeyPressed  then
  15.     begin
  16.       Read(kbd,ech);   ch := #00;
  17.       case Ord(ech)  of
  18.         15 : ch := ^O;  { BACK TAB }
  19.  
  20.         59 : ch := #131;{ PF 1 (HELP) KEY }
  21.         60 : ch := #132;{ PF 2 }
  22.         61 : ch := #133;{ PF 3 }
  23.         62 : ch := #134;{ PF 4 }
  24.         63 : ch := #135;{ PF 5 }
  25.         64 : ch := #136;{ PF 6 }
  26.         65 : ch := #137;{ PF 7 }
  27.         66 : ch := #138;{ PF 8 }
  28.         67 : ch := #139;{ PF 9 }
  29.         68 : ch := #140;{ PF 10 }
  30.  
  31.         72 : ch := ^E;  { CURSOR UP }
  32.         73 : ch := ^W;  { PAGE UP }
  33.         75 : ch := ^S;  { CURSOR LEFT }
  34.         77 : ch := ^D;  { CURSOR RIGHT }
  35.         79 : ch := ^F;  { END }
  36.         80 : ch := ^X;  { CURSOR DOWN }
  37.         81 : ch := ^Z;  { PAGE DOWN }
  38.         82 : ch := ^U;  { INSERT }
  39.         83 : ch := ^G;  { DELETE }
  40.       else Write(^G);  (* Sound Speaker *)
  41.       end;  {case }
  42.     end;
  43. end;   {  ReadIBMch  }
  44.  
  45.