home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6384 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.7 KB  |  60 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!caen!umeecs!quip.eecs.umich.edu!joy
  3. From: joy@quip.eecs.umich.edu (Chien-Chung Chen)
  4. Subject: Re: reading alternate keys on ibm from turbo
  5. Message-ID: <1992Nov6.211128.19865@zip.eecs.umich.edu>
  6. Sender: news@zip.eecs.umich.edu (Mr. News)
  7. Organization: University of Michigan EECS Dept., Ann Arbor
  8. References: <1dbruiINNbai@uwm.edu> <73862@hydra.gatech.EDU> <1deij2INNnva@uwm.edu>
  9. Distribution: usa
  10. Date: Fri, 6 Nov 1992 21:11:28 GMT
  11. Lines: 47
  12.  
  13. In article <1deij2INNnva@uwm.edu> randyd@csd4.csd.uwm.edu (Randall Elton Ding) writes:
  14. >In article <73862@hydra.gatech.EDU> gtd205a@prism.gatech.EDU (James Houghton Crouch) writes:
  15. >>>procedure keyread (var ch: char; var alt: boolean);
  16. >>>  begin
  17. >>>    ch:= readkey;
  18. >>>    alt:= (ch=#0) and keypressed;
  19. >>>    if alt then ch:= readkey;
  20. >>>  end;
  21. >>
  22. >>I think that this program will also return the arrow
  23. >>keys, PageUp, PageDown, and quite a few others.  
  24. >>
  25. >>I'm pretty sure that TP firsts reads a #0 and then a code for these keys
  26. >>too
  27. >
  28. >Yes, That was the whole purpose for posting that function.
  29. >The origional question was "how do I read page up/page down ...etc..."!
  30. >My keyread function does in fact read everything except function keys
  31. >11 and 12.  Does anyone know how to read these two function keys 
  32. >from TP?
  33. >
  34. >randyd@csd4.csd.uwm.edu
  35.  
  36. The following is a TP program that I wrote long time ago. I think it
  37. might help.
  38.  
  39.  
  40. -- Chien-Chung Chen
  41.  
  42. ---------------
  43.  
  44. { This program generates the scan code for the enhanced (101) keyboard. }
  45. program scan_enhance;
  46. uses crt, dos;
  47. const
  48.    zf = $40;
  49. var
  50.    regs: registers;
  51. begin
  52.    repeat
  53.       regs.ah := $11;
  54.       intr($16, regs);
  55.    until (regs.flags and zf)=0;
  56.    regs.ah := $10;
  57.    intr($16, regs);
  58.    writeln(regs.al:3, regs.ah:10)
  59. end.
  60.