help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: S-up and emacs -nw?


From: Stefan Monnier <address@hidden>
Subject: Re: S-up and emacs -nw?
Date: 21 Oct 2002 09:22:28 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
> 2) What's the relationship between terminal type, loadkey/keymap,
>    and termcap/terminfo?

The terminfo data tells the application what code to send to display
what it wants (i.e. how to clear the screen, how to advance by one char,
...) as well as what the terminal sends for some special keys.
This second part only covers a few "standard" keys but not all.
So the terminal might be able to generate some key-codes which the
application will not understand (at least not by looking at terminfo).
In the case of Emacs, you can tell it what those codes mean via
function-key-map which is initialized based on the terminfo database.

>    change the keymap and expect whatever program is running to
>    suddenly be able to generate those sequences?

The program does not generate those sequences, it only receives them
and has to interpret them.  You hit a key -> the terminal
emulator (in your case it's mostly all in the Linux kernel) notices it
-> looks up the keymap you've defined via loadkeys to know which
byte-sequence to use for it -> and sends to the application the
corresponding byte-sequence.

I.e. you need to invent unused byte-sequences for each new key you want to
handle, and then tell loadkeys how to map the key to the byte-sequence and
tell Emacs's function-key-map how to map the byte-sequence back to the key.


        Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]