home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / msdos / programm / 2274 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.0 KB  |  57 lines

  1. Newsgroups: alt.msdos.programmer
  2. Path: sparky!uunet!stanford.edu!agate!boulder!alumni.cs.colorado.edu!boggs
  3. From: boggs@alumni.cs.colorado.edu (Adam Boggs)
  4. Subject: Old dos keyboard int interfering?
  5. Message-ID: <1992Aug27.063306.13226@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: alumni.cs.colorado.edu
  8. Organization: University of Colorado, Boulder
  9. Date: Thu, 27 Aug 1992 06:33:06 GMT
  10. Lines: 45
  11.  
  12. I believe I've posted this once before a long time ago, but didn't get any
  13. replies.  Now that we're on the subject of keyboard interrupts, I thought I'd
  14. ask again.
  15.  
  16. I am writing my own BBS package, and grab the keyboard interrupt to re-direct
  17. the input to my own buffers, where I parse it with my own routines.  Some of
  18. the characters, however, I check for inside the interrupt, and set status
  19. flage appropriatly.  My problem is that some of the characters (^S and ^P)
  20. don't seem to get passed to my interrupt.  ^S just crashes my system, and
  21. ^P tries to output to the printer after I exit the program. (I am aware that
  22. ^S is pause and ^P turns on the printer).  Anyway, my assumption is that DOS
  23. (or my shell? I'm using NDOS) captures these.  Can I avoid that... Here's
  24. basically what my code looks like:
  25.  
  26. void far interrupt comint()
  27. {
  28.    (*OldKeyVec) ();
  29.  
  30.    if (kbhit()) {
  31.       inchar = bioskey(0);
  32.  
  33.       switch (inchar) {
  34.          case XOFF: ...
  35.                     break;
  36.          case '\x10': ...     /* ^P   */
  37.                     break;
  38.       }
  39.    }
  40.    outp(0x20, 0x20);          /* Hardware int exit routine  */
  41. }
  42.  
  43. There are other keys that are compared, but they all seem to work except
  44. for ^S and ^P.  I call (*OldKeyVec)() at the beginning because it changes
  45. the keyboard scan codes to ascii for me (an presumably does something with
  46. my problem characters).  Another possibility is that bioskey() messes it
  47. up. (I'm using TC++ 1.0)  
  48.  
  49. So, basically, do I need to write something myself that manages the scan codes,
  50. and get rid of (*OldKeyVec)()?  How would I do that if so?
  51.  
  52. Thanks in advance for any help...
  53.  
  54. -Adam Boggs
  55. boggs@alumni.cs.colorado.edu
  56.  
  57.