home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / alt / msdos / programm / 2091 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  4.0 KB

  1. Xref: sparky alt.msdos.programmer:2091 comp.lang.pascal:4592
  2. Path: sparky!uunet!wupost!usc!sol.ctr.columbia.edu!emory!wa4mei!nanovx!mycro!scott
  3. From: scott@mycro.UUCP (Scott C. Sadow)
  4. Newsgroups: alt.msdos.programmer,comp.lang.pascal
  5. Subject: Re: Stealing INT 09h
  6. Message-ID: <1992Jul28.092657@mycro.UUCP>
  7. Date: 28 Jul 92 13:26:57 GMT
  8. References: <1992Jul26.131309.11896@miavx1.acs.muohio.edu>
  9. Lines: 99
  10.  
  11. In article <1992Jul26.131309.11896@miavx1.acs.muohio.edu>, sjmadsen@miavx1.acs.muohio.edu (Steve Madsen) writes:
  12. >
  13. >        I'm interested in writing a keyboard handler by going through INT 09. 
  14. >The only problem is that I have just about no idea how to do this.  It's all
  15. >part of a "bigger picture."  In the end, I'd like to be able to have a separate
  16. >text screen for each task running in a program, and be able to switch between
  17. >these tasks (and their text screens) by pressing Alt-Tab, much like MS Windows.
  18. >
  19. >        If what I've seen here on the net is correct, the keyboard scan code
  20. >will appear at Port[$60].  (Pascal notation, here.)  If it's possible, I'd like
  21. >to write the handler so that the Alt-Tab combination is the only one I deal
  22. >with.  If the built in handler can handle the keypress, I'd love to just pass
  23. >it through to that code instead.  Is this possible?
  24. >
  25. >        Finally, is there any way I can take the Alt-Tab keypress, assign it an
  26. >unused Pascal "extended keycode" and stuff it in the buffer?  This would be the
  27. >ideal solution, as it would allow me to support any other keypresses that
  28. >Pascal doesn't currently support, should I need them in the future.
  29. >
  30. >        What might make this chore even easier would be if someone has a
  31. >Pascal-ready handler already written and would like to refer me to a copy.. :)
  32. >
  33. >        Any help would be greatly appreciated!
  34. >
  35. >-- 
  36. >Steve Madsen
  37. >Miami University  Oxford, OH
  38. >Internet: sjmadsen@miavx1.acs.muohio.edu
  39.  
  40.  
  41. For most AT class machines (80286 and above) there is an interrupt for
  42. intercepting keystrokes. There is another interrupt (INT 15/AH=C0h) that
  43. indicates if this interrupt is supported. (Documentation on these 3
  44. interrupts extracted from Ralf Brown's Interrupt List). For this
  45. interrupt, trap the TAB key, then look to see if the SHIFT key is down.
  46. (There is a BIOS interrupt to get the SHIFT, ALT, CTRL, etc states. For a
  47. TSR, I would use the actual BIOS address, 40:??, to check the SHIFT state)
  48.  
  49.  
  50. INT 15 - OS HOOK - KEYBOARD INTERCEPT (AT model 3x9,XT2,XT286,CONV,PS)
  51.    AH = 4Fh
  52.    AL = hardware scan code
  53.    CF set
  54. Return: CF set
  55.       AL = hardware scan code
  56.    CF clear
  57.       scan code should be ignored
  58. Note: called by INT 9 handler to translate scan codes; the INT 09 code does
  59.      not examine the scan code it reads from the keyboard until after
  60.      this function returns.  This permits software to rearrange the
  61.      keyboard; for example, swapping the CapsLock and Control keys, or
  62.      turning the right Shift key into Enter.
  63.  
  64.  
  65.  
  66. (Information on this interrupt was shortened to just what was needed for
  67. this post. Refer to the full interrupt list for more info)
  68.  
  69. INT 15 - SYSTEM - GET CONFIGURATION (XT after 1/10/86,AT mdl 3x9,CONV,XT286,PS)
  70.    AH = C0h
  71. Return: CF set if BIOS doesn't support call
  72.    CF clear on success
  73.        ES:BX -> ROM table (see below)
  74.    AH = status
  75.        00h successful
  76.        86h unsupported function
  77.  
  78. Format of ROM configuration table:
  79. Offset   Size  Description
  80.    (stuff deleted)
  81.  05h  BYTE  feature byte 1:
  82.       bit 4 = INT 15/AH=4Fh called upon INT 9h
  83.    (stuff deleted)
  84.  
  85.  
  86.  
  87. There is also a "SYSRQ" key that you can use that generates its own
  88. interrupt. (The SYSRQ key is usually ALT-Print Screen)
  89.  
  90. INT 15 - OS HOOK - SysRq KEY ACTIVITY (AT,PS)
  91.    AH = 85h
  92.    AL = 00h SysRq key pressed
  93.       = 01h SysRq key released
  94.    CF clear
  95. Return: CF clear if successful
  96.        AH = 00h
  97.    CF set on error
  98.        AH = status (see AH=84h)
  99. Notes:   called by keyboard decode routine
  100.    the default handler simply returns successfully; programs which wish
  101.      to monitor the SysRq key must hook this call
  102.  
  103.  
  104. Hope this helps...
  105.  
  106.  
  107.    Scott C. Sadow
  108.    scott@mycro.UUCP
  109.    ...gatech!nanovx!mycro!scott
  110.