[comp.emacs] Using an <alt> key with Emacs and Xenix

rfarris@serene.CTS.COM (Rick Farris) (09/10/88)

In article <156@serene.CTS.COM> I wrote:

% Can anyone tell me how I can use my alt-key on my pc instead of <esc>
% prefixes? I would really like to be able to substitute say <alt><d>
% for delete-word for <esc>-<d>.  

I received a number of replies.  Mike Khaw (mkhaw%teknowledge.arpa) replied:

% If your alt key turns on the high-bit in an 8-bit byte, the comm. line
% and Xenix terminal driver must support 8-bit data.  In addition, your
% "terminal type" under Xenix needs a termcap entry that includes the
% "km" (key meta) capability.  If emacs uses terminfo instead, I'm not sure
% what the answer is.


Keith Gabryelski (...crash!elgar!ag) added:

% Closer inspection into Sco Xenix documention (RTFM) revealed a very
% robust keyboard mapping scheme.  Using mapkey(M) and its counter parts
% mapstr(M), and mapscrn(M) you (the system administrator) can set your
% console keyboard to do most anything.  You can also setup keyboard
% maps on a per screen basis.
% 
% Several keymaps are supplied with your sco xenix system.  They are in
% the directory /usr/lib/keyboard and are used to remap keyboards for
% use in other countries.
% 
% Below is the mapkey file I have installed on my system.  This map
% makes the alt-key a true "Meta-key".  I have this mapkey loaded at
% boot time from /etc/rc.
% 
% A meta key is similar to a control key in that you hold it down and
% press another key to get a key not usually available on you keyboard
% EXCEPT instead of sending a value from 0x00 (^@) to 0x1F (^_) [the
% control characters] the meta key will send a value from 0x80 (~^@)
% to 0xFF (~^?) [the meta-characters].
% 
% I have included a program called "octopus" which when run will give
% you information on the keys sent from the keyboard.

In Summary:

You have to add "km" to your terminfo/cap entry, and recompile it.  Use the
mapkey (Xenix) command to map a new keymap into your terminal.  And finally,
(in Unipress Emacs) you have to set the variable "use-meta-bit" to 1.

Now <alt> keystrokes work just like <esc>-<key> keystrokes.

I have Keith Gabryelski's "metakey" keyboard map, and would be happy to mail
copies to anyone who'd like one.  I'll also send his "octopus" program that
accepts your keystrokes and shows (in several formats) exactly what is
being returned.

My next project will be to add significant functionality to the "ansi" term
driver as supplied by SCO.

                      _______________________________
Rick Farris          |     rfarris@serene.cts.com    |   Voice  (619) 259-6793
POB M                |   <backbone>!serene!rfarris   |   BBS          259-7757
Del Mar, CA 92014    |_______________________________|   serene.UUCP  259-3704

If carpenters built buildings the way most programmers write programs,
         the first woodpecker that came along would destroy civilization. . .

wisner@killer.DALLAS.TX.US (Bill Wisner) (09/20/88)

If you don't want to muck about with your termcap entry, you can
set an emacs variable that means the same thing.

(setq meta-flag t)