*** kbd_emul.c~ Tue May 31 15:59:32 1988 --- kbd_emul.c Sat Jul 25 04:36:05 1992 *************** *** 235,242 **** --- 235,257 ---- n = KBD_INDEX_NUMLOCK; #endif AT_KEYBOARD #endif ATR + + /* + * If ALT_META is defined, the ALT keys are no longer + * treated as standard modifiers. Instead, any key + * that is pressed while ALT is active will have (1) an + * ESC stuffed into the input buffer ahead of it if + * META_8BIT is not defined, or (2) the high bit set + * if META_8BIT is defined. + * Barr3y Jaspan, , 21 Oct 1991 + */ + + #define ALT_META + #define META_8BIT + #ifndef ALT_META else if (kbd_state & (ALT1_MODE | ALT2_MODE)) n = KBD_INDEX_ALT; + #endif else if (kbd_state & CTL_MODE) n = KBD_INDEX_CONTROL; else if ((kbd_state & CAPS_MODE) && *************** *** 264,270 **** --- 279,300 ---- kbd_send(si,&kbd_strings[c],KBD_STRING_LENGTH,1); c = NONE; /* for gets */ } else { + #ifdef ALT_META + if (kbd_state & (ALT1_MODE | ALT2_MODE)) { + #ifdef META_8BIT + *(p+1) |= 0x80; + #else + char esc = '\033'; + kbd_send(si, &esc, 1, 1); + #endif /* META_8BIT */ + } + #endif /* ALT_META */ kbd_send(si,p+1,MAX_CHAR_LENGTH,1); /* send the string */ + #ifdef ALT_META + #ifdef META_8BIT + *(p+1) &= 0x7f; + #endif + #endif c = *(p+1); } }