hitchens@ut-sally.UUCP (Ron Hitchens) (12/04/84)
[MacBug line] Recently someone posted instructions for patching the tilde key in MacTerminal, Here's the info you need to patch any key to anything. Following is a copy of the notes I made up after spending a few hours poking around inside of MacTerm with FEdit (which you'll need to patch MacTerm, it's available via anonymous ftp from ut-sally or sumex-aim): ------- Layout of the Macterminal keymap table for vt100 mode There is a lookup table in Macterminal which specifies the character to be transmitted for each key-down event on the keyboard. When using FEdit (in hex mode) to examine the resource fork of the MacTerminal application, the table begins in block #5 (A is the first entry), occupies all of #6, and ends in #7. The tilde key is the last printable key in the table, followed by the backspace key, then the Enter key. Entries for the optional keypad follow that, these entries are encode in some way, supposedly to show they're inactive, but I couldn't see an obvious relationship to their ascii counterparts. Each key on the keyboard has sixteen bytes in the table which define the codes to be sent for each of the possible combinations of that key plus the four modifier keys. The four modifiers are: cmd, shift, option and caps lock. Numbered from 0-15, left to right, the byte positions represent: 0 - Unshifted (no modifiers) 1 - Command 2 - Shift 3 - Shift/Command 4 - Caps Lock 5 - Caps Lock/Command 6 - Caps Lock/Shift 7 - Caps Lock/Shift/Command 8 - Option 9 - Option/Command 10 - Option/Shift 11 - Option/Shift/Command 12 - Option/Caps Lock 13 - Option/Caps Lcok/Command 14 - Option/Caps Lock/Shift 15 - Option/Caps Lock/Shift/Command Apparently unused codes should contain FF, but pressing one of these combinations seems to produce a del (FF minus parity bit -> 7F) The code FC, seems to cause a break signal to be sent. The code FB, seems to be the effective 'do-nothing' code, nothing is sent. There are other codes used in this range, I didn't research them all. ---- The changes I've made, which make MacTerm much easier to use with Unix, are: tilde key: unshifted=esc, cmd=`, shift=~ (same in second half, +opt) backspace: unshifted=del, cmd=^H, shift=^H enter key: unshifted=^J (new line), cmd=send break 2 key: cmd=^@ - key: cmd=^_ (these two to get control forms of the uppercase char) If you would prefer using option as the control key, you can change byte number 8 (option modifier only) to the control value (in byte 1) for each of the 26 alpha keys. This would yield perhaps the first keyboard in history with a control key on both sides. There is another table for tty mode, maybe a third for 3278 mode, I don't know where it (they) are, I never use those modes so I didn't bother looking. -------- Ron Hitchens hitchens@ut-sally "So far, everything has happened prior to now"