
 [76174,105]h+ MACTER.KEY     23-Dec-84 5235         143o  sH     Keywords: MACTERMINAL PATCHS KEYS KEYCODES KEYPAD KEYBOARD MAPPING     RESOURCESh  tL     An explanation of how the resources are used in MacTerminal to map theO     individual keys into transmitted characters.  Also outlined is the method O     for mapping keyboard keys into keypad keys.  This file is for experiencedO     bit twiddlers who want to change the behavior of MacTerminal to fit their .     needs on their particular host computer.   :                         - Jonathan E. Hardis [76174,105]P -----------------------------------------------------------------------------       I                           CUSTOMIZING MACTERMINAL              12/23/84       J The following was posted to info-mac, a Macintosh news group on Arpanet.I I have copied it by hand, and hopefully have not introduced any errors. E Notes in brackets refer to my footnotes at the end of the document.         * From:  lsr@apple.UUCP (Larry Rosenstein) Date:  4 Dec 84 01:35:37 GMT$ Organization: Apple Computer, Inc.  AK After all the complaints about the MacTerminal keyboard, I feel compellede to post this message.r   H The mapping between keycaps and ASCII characters is totally defined inL resource files (of course)!  Because of the way resources are found, it isI possible to setup the keyboard mapping on a document-by-document basis, I which is much better than having multiple copies of MacTerminal around..   L There are 3 resource types to consider.  (In the following, I describe the= contents of the resource in terms of a Pascal declaration.)    3 (1) Type KCKI: PACKED ARRAY[KeyCode] OF KeyIndex,R<                where KeyCode = 0..95 and KeyIndex = 1..71.H This maps the standard keycode numbers into the range 1..71.  [Note 1]  a* (2) Type KICH: ARRAY[KeyIndex] OF Entry,;                where Entry = PACKED ARRAY[0..15] OF CHAR.oI This maps the KeyIndex and the state of the modifier keys into an ASCIIi@ character.  (The modifier bits are in the same order as in the EventRecord.)     [Note 2]  a8 (3) Type CHRT: PACKED ARRAY[Boolean, Char] of Boolean.K This maps the state of the command key and the ASCII character (from (2))eK into TRUE if repeating is allowed for that key if the Repeat Ctrls optione4 is off.  (I am not 100% sure about this, however.)  mM There are 2 resources of each type; ID = 256 is for VT100/TTY mode and ID =l 257 if for IBM mode.  rN I was able to customize one of my documents by using RMover [Note 3] to copyG the appropriate resources into the document, and using FEdit [Note 4]  to modify them.K  PL NOTE: I believe this information is accurate, but I have not verified thisK with the MacTerminal authors.  (So don't blame them or Apple if something. goes wrong, blame me.)  e Good Luck, and Enjoy!   , Larry Rosenstein  EO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -h  iF [Note 1]:  Keycodes are discussed in Event Manager section of InsideF            Macintosh.  Quickly, each physical button on the keyboardF            and the keypad send a "Keycode" to the machine, which hasH            nothing to do with what letter is printed on the key or anyE            particular character set (ASCII or EBCDIC, for example).t   ;            The key codes are, row by row on the keyboard:e6            50 18 19 20 21 23 22 26 28 25 29 27 24 516            48 12 13 14 15 17 16 32 34 31 35 33 30 420            00 01 02 03 05 04 38 40 37 41 39 36*            06 07 08 09 11 45 46 43 47 44'            Space Bar = 49, Enter = 52   K(            And on the optional keypad:            71 78 70 66            89 92 93 77            86 87 88 72            83 84 85 76             82   65s  gG [Note 2]:  Option, Caps Lock, Shift, and Command keys do not generateG            keycodes.  Instead, they make up, in that order, the four- H            bit (0-15) modifier field.  For example, you should usuallyG            treat Caps Lock (4) and Shift (2) the same.  Command/Shift '            would be represented as 3.   aG [Note 3]:  RMOVER can be found in DL 5.  It is very buggy, and shouldt8            be used with caution on backup copies only.  hH [Note 4]:  As of this writing, FEDIT is no longer in MAUG.  The authorK            has indicated that a new, improved version may be posted soon.2K            It is a public domain program which may be found at your local E            Apple dealer or User Group on their public domain disks.1I            REDIT (Resource Editor) is a newer program on DL 5 which can L            (in theory) do the same thing, and is easier since it knows howL            to find and display the particular resources in an orderly way.G            As of this writing, REDIT is in its first debut outside ofgF            Apple and is very buggy.  Use with caution only on backupM            copies.  It can (in theory) both edit and move resources betweenuN            the MacTerminal application and individual MacTerminal documents.   O So what does all this mean?  It means if there are characters you need to get5N to on the keyboard, such as the tilde (~) or rubout (found on many terminalsN and used a lot on DEC computers) you can change any key, with or without anyO combination of Option, Caps Lock, Shift, and Command, to transmit the correct L code.  It also means that you can map the keypad keys (if you don't have aJ keypad) into keyboard keys!  For example, you can make Option-1 equal toF 1 on the Keypad.  (And I just bought my keypad two days ago. AARGH!)   J Instead of detailing for the novice on how to do all the patches, if youH succeed in making good resources for a particular situation, such as aI popular keypad editor on a popular computer, put the modified resourcese8 into a MacTerminal _document_ and upload the document.  n     p:                                     - Jonathan E. Hardis3                                       [76174,105]p  i