home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / keyboard / swpkeyat.doc < prev    next >
Internet Message Format  |  1994-03-07  |  3KB

  1. Date: 10 Jul 1985 19:19:24 PDT
  2. Subject: Swapping "Esc" and "~" on AT -- SWPKEYAT
  3. From: Craig Milo Rogers  <ROGERS@USC-ISIB.ARPA>
  4.  
  5.  
  6.     I've recently gotten an IBM-PC/AT.  Boy, am I burned by the
  7. ill-positioned "Esc" key.  So, I decided to "fix" things.
  8.  
  9.     I started by prying up the key tops of the "Esc" and "~" (tilde)
  10. keys, and swapping them.  Of course, that didn't really fix anything,
  11. but it did show me what my goal looked like.
  12.  
  13.     Next, I decided to write a low-level BIOS extension which intercepts
  14. and swaps key codes to implement the key cap swap I described above.  The
  15. result was SWPKEYAT.ASM, which has been submitted to the INFO-IBMPC library.
  16. SWPKEYAT swaps by intercepting the keyboard hardware interrupt, since
  17. I thought that would fool as much software as possible.  The program is
  18. rather ugly, though:  after swapping key scan codes it jumps into the
  19. AT's ROM BIOS keyboard hardware interrupt routine.
  20.  
  21.     So far, so good.  DOS is perfectly happy, and so are any programs
  22. which do DOS or BIOS keyboard I/O.  In particular, both VDTE and KERMIT
  23. run OK.
  24.  
  25.     But, what about programs that do their own sub-BIOS keyboard
  26. scan conversions?  Luckily for me, I don't run many programs like that.
  27. However, I absolutely had to fix my copy of Lugaru Epsilon.  So, I used
  28. DEBUG to disassemble and trace Epsilon until I found the (single) location
  29. where it was reading the keyboard port.
  30.  
  31.     It takes several instructions to swap the keyboard scan codes.
  32. I couldn't find an easy way to insert the entire sequence into Epsilon.
  33. So, I added an additional interrupt handler to SWPKEYAT.  The new interrupt
  34. does an IN AL,60 (reading the keyboard port) and swaps the appropriate
  35. pair of scan codes.  I selected INT 3FH from the end of the "Reserved for
  36. DOS" range for this function.
  37.  
  38.     The appropriate location to patch in Epsilon 2.02 is offset
  39. BDBE.  I copied EPSILON.EXE to EPSILON.XXX and ran DEBUG on EPSILON.XXX.
  40. The .EXE-file offset became C4BE.  I patched that location, wrote the
  41. file back out, and renamed the result to XXX.EXE.  Once I had confirmed
  42. that my patched version worked, I renamed XXX.EXE to EPSILON.EXE.
  43.  
  44.     So much for this hack.  If you use SWPKEYAT and run into a program
  45. which doesn't see the swap (CodeSmith ((tm) Visual Age) may be a candidate),
  46. I'll be interested in hearing about the problem (but probably won't fix it).
  47.  
  48.                     Craig Milo Rogers
  49.  
  50.  
  51.  
  52. ------------------------------
  53.  
  54. Date: 11 Jul 85 15:26:00 EDT
  55. From: TD9H@CMU-CC-TE.ARPA <TD9H@CMU-CC-TE>
  56. To: rogers%usc-isib@USC-MAILNET
  57. cc: brackenridge%usc-isib@USC-MAILNET
  58. Subject: Epsilon Patch for SWPKEYAT
  59.  
  60.  
  61. Epsilon 3.0 allows you to remap keys at the level of the keyboard
  62. interrupt (far below the command/key binding level).  It sounds like
  63. your patch will do till then.
  64.  
  65.  
  66. Todd Doucet
  67. Lugaru Software Ltd.
  68.  
  69. [Todd informs me version 3.0 of Epsilon will be released "real soon now". -wab]
  70.  
  71.  
  72. ------------------------------
  73.