home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10514 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  1.6 KB

  1. Path: sparky!uunet!sun-barr!sh.wide!wnoc-tyo-news!nec-tyo!nec-gw!sgiblab!spool.mu.edu!agate!usenet.ins.cwru.edu!cleveland.Freenet.Edu!ci922
  2. From: ci922@cleveland.Freenet.Edu (Duane A. Paulson)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: putting chars back to keyboard buffer...
  5. Date: 11 Nov 1992 17:38:31 GMT
  6. Organization: Case Western Reserve University, Cleveland, OH (USA)
  7. Lines: 34
  8. Message-ID: <1drgenINNsea@usenet.INS.CWRU.Edu>
  9. References: <1992Nov10.204616.25750@slate.mines.colorado.edu>
  10. Reply-To: ci922@cleveland.Freenet.Edu (Duane A. Paulson)
  11. NNTP-Posting-Host: hela.ins.cwru.edu
  12.  
  13.  
  14. In a previous article, iarit@slate.mines.colorado.edu (ARIT ISMAIL) says:
  15.  
  16. >
  17. >Hi,
  18. >
  19. >I am writing  a small TSR that will put a string back
  20. >to the keyboard buffer. I got some ideas how to use keyboard 'head'
  21. >and 'tail' pointers, but still confused a bit. I understand what the
  22. >'tail' is and how to use it, but 'head' is confusing..
  23. >Does anybody have any 'C' function/idea how to put chars back to
  24. >keyboard buffer without crashing/rebooting the system?
  25. >Any idea/help is appreciated..
  26. >Thanks.
  27. >iarit@slate.mines.colorado.edu
  28. >
  29.  
  30. You'll have to go all the way down to the system for this one. Function 05
  31. of interrupt 16hex will stuff a single character into the keyboard buffer
  32. for you. Repeat as needed until buffer full. Here's how to set it up:
  33.  
  34.   ah=05
  35.   ch=scan code for key
  36.   cl=ascii code for character
  37.   call interrupt 0x16
  38.  
  39.   On return:
  40.   ah=0 means function successful
  41.   ah=1 means keyboard buffer was full
  42.  
  43. -- 
  44. Duane Paulson
  45. ci922@cleveland.freenet.edu
  46. duane.paulson@pcb.batpad.lgb.ca.us
  47.